I have a class that extends Application class Here is My Application class
public class UILApplication extends Application {
public int count_group;
public LoginUserInfo loginUserInfo = new LoginUserInfo();
public static ArrayList<PostCategory> featuredCategory = new ArrayList<PostCategory>();
public ItemsAllPost selectedPost;
public PostCategory selectedCategory;
public PostCategory selectedSubCategory;
public ArrayList<PostCategory> categoryList = new ArrayList<PostCategory>();
public ArrayList<PostCategory> searchCategoryList = new ArrayList<PostCategory>();
public ArrayList<PostCategory> timePeriod = new ArrayList<PostCategory>();
public ArrayList<PostCategory> tagsList = new ArrayList<PostCategory>();
public ArrayList<ItemsAllPost> featuredPost = new ArrayList<ItemsAllPost>();
public ArrayList<ItemsAllPost> searchList = new ArrayList<ItemsAllPost>();
}
I have saved lot of data in it and using it in different Activity and Fragments
Now problem is When i press home button and come back to app after long time then it crashes.
Can anyone tell me how do i save this data when leaving the application and retain its state when i am back in application.
Please help.