开发者

Reload application data when the android app comes into foreground..?

开发者 https://www.devze.com 2023-02-27 02:22 出处:网络
Here is the scene what i am facing..when i press home key it saves the current state of the current activity..so when my app comes in foreground, onResume() of that particular activity gets called who

Here is the scene what i am facing..when i press home key it saves the current state of the current activity..so when my app comes in foreground, onResume() of that particular activity gets called who's state was saved. So if an app with say 10 activities are there then, we will need to write reload of app data in each activity's onResume()..is there a way to specify a reload o开发者_Python百科f app data in one activity only..?


Jitesh,

Yes, this is possible. You will probably want to perform the reloading of application data in your Activity's onResume() function. See Android Activity Lifecycle.

0

精彩评论

暂无评论...
验证码 换一张
取 消