1

THIS IS NOT A DUPLICATE!

THE SUGGESTED POST IS ABOUT NESTED FRAGMENTS.

THIS IS NOT THAT CASE.


Please correct me if I am wrong, but it seems that onAttach() is not being called if I set setRetainInstance(true)!!

That would void what it's being said here https://stackoverflow.com/a/20775934/1815311

and here http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html

and here https://plus.google.com/u/0/+AlexLockwood/posts/etWuiiRiqLf


Possible that even Google is wrong with this?? http://developer.android.com/reference/android/app/Fragment.html#setRetainInstance(boolean)

public void setRetainInstance (boolean retain)

Added in API level 11 Control whether a fragment instance is retained across Activity re-creation (such as from a configuration change). This can only be used with fragments not in the back stack. If set, the fragment lifecycle will be slightly different when an activity is recreated:

[...]

  • onAttach(Activity) and onActivityCreated(Bundle) will still be called
Community
  • 1
  • 1
Lisa Anne
  • 4,482
  • 17
  • 83
  • 157
  • Hi, I know it's a possibly a duplicate, but I think this problem has not received enough attention, the implications are not irrelevant and an authoritative answer would be appreciated, since Google itself seems to be wrong in this case. See my EDIT – Lisa Anne Apr 18 '15 at 19:56

0 Answers0