Friday, 15 May 2015

Android Support Library: Retained Fragment lifecycle -



Android Support Library: Retained Fragment lifecycle -

i'm experiencing perchance unusual behavior retained fragment. situation: i've retained fragment when configuration alter occurs in hosting activity not recreated (i.e., oncreate method not invoked) expect. unusual thing following: if hosting activity recreated due memory pressure level (you can forcefulness opening many other apps depending on ram available on device) receives bundle != null in oncreate , oncreate method of retained fragment called too. seems unusual me given retained fragment. can find docs related behavior?

if reproduce behavior can seek back upwards library sample "retain instance" declared in "fragmentretaininstancesupport.java"

thanks help.

if hosting activity recreated due memory pressure level (you can forcefulness opening many other apps depending on ram available on device) receives bundle != null in oncreate , oncreate method of retained fragment called too

well if there memory problem resulted in activity beingness killed wouldn't have high hopes fragment. if app killed, nil survives. cannot escape lifecycle. may able cut down chances of fragment or activity beingness recreated, cannot prevent it.

you have programme app in mind. may killed @ moment, app needs survive without exceptions , cannot depend on not beingness recreated or killed.

android android-fragments android-support-library

No comments:

Post a Comment