[android-developers] Re: Fragment isAdded() issue ?

2011-08-01 Thread Guian
any more comment on this ? On 22 juil, 11:00, Guian guiandou...@gmail.com wrote: but I'm not adding  twice the same fragment in one fragment transaction. here is what happens : 1) launch app = call to  onTabSelected = add my fragment with this piece of code:

[android-developers] Re: Fragment isAdded() issue ?

2011-07-22 Thread Guian
but I'm not adding twice the same fragment in one fragment transaction. here is what happens : 1) launch app = call to onTabSelected = add my fragment with this piece of code: if(!fragmentsToAdd.isAdded()) ft.add( R.id.parent, fragmentsToAdd, myFragment); 2) pressing the Back

[android-developers] Re: Fragment isAdded() issue ?

2011-07-21 Thread Gab
I have a same problem, my fragment lost the reference of activity after pause/resume... I don't understand the fragment's lifecycle. On 19 juil, 15:10, Guian guiandou...@gmail.com wrote: well well ... here is the fix I used : on the creation of my fragment I add a test in

Re: [android-developers] Re: Fragment isAdded() issue ?

2011-07-21 Thread Dianne Hackborn
Committing a fragment is asynchronous; isAdded() doesn't return true until the transaction is committed. On Thu, Jul 21, 2011 at 9:33 AM, Gab gabriel.del...@gmail.com wrote: I have a same problem, my fragment lost the reference of activity after pause/resume... I don't understand the

[android-developers] Re: Fragment isAdded() issue ?

2011-07-19 Thread Guian
I've seen that isAdded() can return false even if the field 'mAdded' in the Fragment is true ? (seen in the 'Variables' view in eclipse ) does anybody know why ? On 19 juil, 11:46, Guian guiandou...@gmail.com wrote: I can't understand how this piece of code :

[android-developers] Re: Fragment isAdded() issue ?

2011-07-19 Thread Guian
here is the source code for isAdded : /** * Return true if the fragment is currently added to its activity. */ final public boolean isAdded() { return mActivity != null mAdded; } indeed ... mActivity is null... I guess I have to recreate this fragment from

[android-developers] Re: Fragment isAdded() issue ?

2011-07-19 Thread Guian
well well ... here is the fix I used : on the creation of my fragment I add a test in fragment.getActivity() is null ... if(testFragment == null || testFragment.getActivity()==null) testFragment = (TestFragment) TestFragment.instantiate(context, com.mypackage.test.MyFragment); and I