Created
November 6, 2014 13:28
-
-
Save RichLogan/5909bc2756b442bf5d93 to your computer and use it in GitHub Desktop.
Get logged in Android user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To Get | |
SharedPreferences account = getSharedPreferences("account", 0); | |
String username = account.getString("username", null); | |
//To Set | |
SharedPreferences account = getSharedPreferences("account", 0); | |
SharedPreferences.Editor edit = account.edit(); | |
edit.putString("username", InsertUsernameHere); | |
edit.commit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment