Save and Store Activity in Android

This question already has an answer here:

  • Saving Android Activity state using Save Instance State 25 answers

  • May be you can create a static object of HashMap and save favorite activities to this and can retrieve activities from that. Something like this.

    This HashMap Object can be kept in Application Class so you can access user list of fav activities anywhere from the App.

    private static final Map<String, Class> favActionMap;
       favActionMap= new HashMap<>();
            favActionMap.put("FAV_1", AddFixtureActivity.class);
            favActionMap.put("FAV_2", AddSwitchActivity.class);
            favActionMap.put("FAV_3", CommissionStatusActivity.class);
    

    To store the data persistently ,save it in database or shared preferences

    链接地址: http://www.djcxy.com/p/26198.html

    上一篇: 我无法保存以前的活动状态

    下一篇: 在Android中保存和存储活动