Application クラスを拡張するクラスがあります。ここに My Application クラスがあります
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>();
}
私はそれに多くのデータを保存し、それをさまざまなアクティビティとフラグメントで使用しました
今の問題は、ホームボタンを押してしばらくしてからアプリに戻ると、クラッシュすることです。
アプリケーションを終了するときにこのデータを保存し、アプリケーションに戻ったときにその状態を保持する方法を教えてください。
助けてください。