xxv / android-lifecycle

A diagram of the Android Activity / Fragment lifecycle
5.26k stars 681 forks source link

Update required for onResume() / onResumeFragments() #8

Open slightfoot opened 10 years ago

slightfoot commented 10 years ago

You've documented a 'wierdness' with v4 compat for onResume/onPostResume. It's worth saying that onResume() should be used for normal Activity's and onResumeFragments() when using the v4 compat library. This is only required when the application is waiting for the initial FragmentTransaction's to be completed by the FragmentManager. For instance the application wants to access a Fragment that was inflated during onCreate(). The best place for this is onResumeFragments().

See: http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html#onResumeFragments%28%29

xxv commented 10 years ago

Yeah, that's a good call. I was having trouble figuring out how to incorporate the differences in v4 vs. standard, but your suggestion of simply stating to use onResumeFragments() instead of onResume() for v4 is a good one.

jeffdav commented 8 years ago

+1

ptran-gpfw commented 8 years ago

+1

slightfoot commented 8 years ago

I think this should still be documented but it looks like they are now fixing several issues. https://youtu.be/k3IT-IJ0J98?t=14m43s (What the Fragment talk from Google I/O 2016)