[android-developers] Re: Fragment Re-instantiation on Activity Restart

2011-11-29 Thread Doug Gordon
To wrap this up, I've found that the arguments "sent" to the fragment with setArguments are preserved when the fragment is reinstantiated by the framework. So what I'm now doing is only creating a new fragment if there is no previous one after a config-change restart. For example: mTabBar = (

[android-developers] Re: Fragment Re-instantiation on Activity Restart

2011-11-29 Thread Doug Gordon
Rony, you are correct, but of course if (savedInstanceState != null) then I'd need to use the manager findFragmentByTag call to find these recreated fragments since I need to be able to add them to their container view and also to be able to call custom methods that update the displayed data, etc.

[android-developers] Re: Fragment Re-instantiation on Activity Restart

2011-11-28 Thread Rony Hotimsky
What exactly you mean with "all sorts of bizarre behavior"? I've seen a problem with fragments duplicating themselves after each screen rotation, and that could be avoided checking if (savedInstanceState == null) before creating them. -- You received this message because you are subscribed to the