How to use onResume()?

后端 未结 8 1789
慢半拍i
慢半拍i 2020-12-04 17:21

Can anyone give me an example that uses onResume() in Android?

Also, if I want to restart the activity at the end of the execution of another, which met

相关标签:
8条回答
  • 2020-12-04 18:02

    Any Activity that restarts has its onResume() method executed first.

    To use this method, do this:

    @Override
    public void onResume(){
        super.onResume();
        // put your code here...
    
    }
    
    0 讨论(0)
  • 2020-12-04 18:02

    Restarting the app will call OnCreate().

    Continuing the app when it is paused will call OnResume(). From the official docs at https://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle here's a diagram of the activity lifecycle.

    0 讨论(0)
提交回复
热议问题