When is the onRestart method called in Android?

While we have the onStart method, what is the purpose of the onRestart method?

@Override
    protected void onStart() {
        super.onStart();
    }



 @Override
    protected void onRestart() {
        super.onRestart();
    }
+4
source share
4 answers

Here is the life cycle of the activity, where there are methods onStart()and onRestart()with explanations

enter image description here

more details here

+4
source

onRestart will be called whenever activity returns from an invisible state. Please follow the link below to find out more.

http://developer.android.com/training/basics/activity-lifecycle/index.html

+2
source

Android: http://developer.android.com/reference/android/app/Activity.html#onRestart()

:

onStop(), ( ). by onStart(), onResume().

, ( managedQuery (android.net.Uri, String [], String, String [], String), , ( onStop().

. , .

+1

this

. Activity , , , onStop() onRestart() ( onStart()). , , , onPause(), .

onStop(), ( ). onStart(), onResume().

, ( managedQuery (android.net.Uri, String [], String, String [], String), , ( onStop().

+1
source

Source: https://habr.com/ru/post/1629326/


All Articles