简体   繁体   English

刷新电话唤醒活动?

[英]Refresh activity on phone wakeup?

In the case where the user suspends the phone when an activity is shown, and then later resumes the phone with the activity shown, I'd like to refresh the data. 如果用户在显示活动时挂起电话,然后在显示活动后恢复电话,我想刷新数据。 But the onStart() does not get called in this case. 但是在这种情况下,不会调用onStart()。 Is there an equivalent event to override for this case? 在这种情况下是否有等效事件要覆盖?

onResume? onResume?

 @Override
    protected void onResume()
       {
         super.onResume();
        //stuff that needs to be restarted
 }

Read this over and over until you really understand and remember it: http://developer.android.com/training/basics/activity-lifecycle/index.html 一遍又一遍地阅读,直到您真正理解并记住它为止: http : //developer.android.com/training/basics/activity-lifecycle/index.html

It will pay off to you, believe me! 相信我,它将为您带来回报! ;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM