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