Is it possible to resume Android after completion ()?

Checking some old code, I found this snippet:

@Override
public void onResume() {
    if (!isFinishing()) {
        ...
    }
    super.onResume();
}

despite calling super.onResume()at the end of a method that is discouraged:

Note. Your implementation of these lifecycle methods should always be called before doing any work, as shown in the examples above http://developer.android.com/guide/components/activities.html

I am worried about the challenge if (!isFinishing()), does that make sense? how can I check that the Activity code variable is mFinishedset to true only on finish()and finishActivity(), is it possible to resume the activity being destroyed through the Android life cycle?

Thanks in advance.

+4
2

, finish() onCreate(). onCreate() javadoc:

finish() , onDestroy() (onStart(), onResume(), onPause() ..).

, isFinishing() onResume()

+1

: "" , .
: isFinishing()

isFinishing: true, , isFinishing() onDestroy() true, , :

"" finish()(isFinishing() false, , )

http://ogrelab.ikratko.com/activity-lifecycle-explained-in-details/

+1

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


All Articles