You can use SharedPreferences or create a Singleton class. I used a singleton class to manage the attribute lifecycle. If you want guaranteed storage, store the data in sqlite db.
Using Singleton, you can store custom objects.
public class MySingleton { private static final AlphResourceSet INSTANCE = new MySingleton (); private MySingleton() {} public static MySingleton getInstance() { return INSTANCE; }
GSree source share