Skip to content

Instantly share code, notes, and snippets.

@AungWinnHtut
Created August 9, 2016 13:58
Show Gist options
  • Save AungWinnHtut/0f20f85481b0d84cb4e91a0ea34a9661 to your computer and use it in GitHub Desktop.
Save AungWinnHtut/0f20f85481b0d84cb4e91a0ea34a9661 to your computer and use it in GitHub Desktop.
public void funSetPass(String code) {
SharedPreferences settings = getSharedPreferences("Protectdata",
MODE_PRIVATE);
SharedPreferences.Editor prefEditor = settings.edit();
prefEditor.putString("com.tech4mm.businesssms.PASS_CODE", code);
prefEditor.commit();
}
public String funGetPass() {
// Do something in response to button
SharedPreferences settings = getSharedPreferences("Protectdata",
MODE_PRIVATE);
String serial = settings
.getString("com.tech4mm.businesssms.PASS_CODE", "");
return serial;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment