Back to project page DoomPlay.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...
If you think the Android project DoomPlay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.api; //from ww w . j a v a 2s . co m import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.preference.PreferenceManager; public class Account { public static final Account account = new Account(); public String access_token; public long user_id; private Account(){} public void save(Context context) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Editor editor=prefs.edit(); editor.putString("access_token", access_token); editor.putLong("user_id", user_id); editor.commit(); } public void restore(Context context) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); access_token=prefs.getString("access_token", null); user_id=prefs.getLong("user_id", 0); } }