[android-developers] Re: Hidden fragments (and animations) after a rotation

2012-04-21 Thread Nadeem Hasan
3/ In your code you re-add the Fragment to the container even if it was > found. It doesn't do harm, but this is unnecessary because the framework > already does it for you. The FragmentTransaction should be inside the if. > You are right, the fragment needs to be added to the container only

[android-developers] Re: Hidden fragments (and animations) after a rotation

2012-04-21 Thread BoD
Thanks for answering. However, 1/ I test savedInstanceState because when it is null it means the Activity was created for the first time (in which case I instantiate and add the fragment). After a rotation it is not null - I agree it is not clear and I should look for the Fragment with a tag in

[android-developers] Re: Hidden fragments (and animations) after a rotation

2012-04-20 Thread Nadeem Hasan
I am not exactly sure if this is the cause of your problem but your fragment creation code is flawed. When you use *setRetainInstance(true)* you don't need to create the fragment every time the activity is created. Also, I don't know why you check for saveInstance to be null. When the phone is

Re: [android-developers] Re: Hidden fragments (and animations) after a rotation

2012-04-20 Thread Kostya Vasilyev
This wouldn't be the first time when the support library is somewhat inconsistent with native platform code. Have you tried debugging into the library code? The sources are available under android-sdk\extras\android\compatibility\v4\src. -- K 20.04.2012 11:43, BoD ???: Thanks for answe

Re: [android-developers] Re: Hidden fragments (and animations) after a rotation

2012-04-20 Thread BoD
Thanks for answering. However I already knew that, and it's not really the point of my question :) -- BoD On 04/20/2012 01:13 AM, lbendlin wrote: Rotating the screen restarts the activity unless you explicitly tell the OS not to do that. On Thursday, April 19, 2012 7:38:52 AM UTC-4, BoD wrot

[android-developers] Re: Hidden fragments (and animations) after a rotation

2012-04-19 Thread lbendlin
Rotating the screen restarts the activity unless you explicitly tell the OS not to do that. On Thursday, April 19, 2012 7:38:52 AM UTC-4, BoD wrote: > > Hi! > > I have an activity with a fragment that I hide in a transaction with a > custom animation. > This transaction is added to the back stac