Android - onPostResume call is called after fragment resumes

I cannot find this answer using the search engine, but in the case of the action that hosts the fragment, when the onPostResume method is called, I assume that any attached fragments of onResume have already been called. who can confirm?

+4
source share
3 answers

Native Activity

final void performResume() {
    ...
    mInstrumentation.callActivityOnResume(this);
    ...
    mFragments.dispatchResume();
    mFragments.execPendingActions();

    onPostResume();
    ...
}

Support FragmentActivity

protected void onPostResume() {
    super.onPostResume();
    ...
    onResumeFragments();
    mFragments.execPendingActions();
}
protected void onResumeFragments() {
    mFragments.dispatchResume();
}

So, it depends on whether you do things with fragments before or after calling super.onPostResume()in @Override.

+7
source

, eclipse, , , . , ...

  • .
  • - - onPostResume.

onResume. . onResumeFragment. , .

+3

Fragment ViewPager. :

: onResume
: onResumeFragments
: onPostResume | : onResume

0

All Articles