Saving data upon closing app and retrieving that data

后端 未结 5 1905
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 01:07

I know, there are plenty of questions in regards to saving/retrieving data on here. I was doing find looking things up on my own and really thought I could manage to find m

5条回答
  •  佛祖请我去吃肉
    2021-01-04 01:51

    When you application needs to save some persistent data you should always do it in onPause() method and rather than onStop(). Because if android OS kills your process then onStop() and onDestroy() methods are never called. Similarly retrieve data in onResume() method.

提交回复
热议问题