Restarting Android application after process is killed

前端 未结 3 1905
广开言路
广开言路 2021-02-04 07:26

When my application is idle, Android kills the process. If user reopens the application after some time, only the top Activity is created - this is a problem for me because the

3条回答
  •  花落未央
    2021-02-04 08:06

    You should probably be looking at storing such Objects in your app's implementation of the Application class.

    If these objects contain state that needs to be more persistent, you should save the state of such Objects in each Activity's onPause() method, either to the database, in SharedPreferences or remotely.

提交回复
热议问题