Tuesday, July 19, 2011

[android-developers] Fragment "isAdded()" issue ?

I can't understand how this piece of code :

if(!fragmentsToAdd.isAdded())
ft.add( R.id.parent, fragmentsToAdd, "myFragment");

can lead to this exeption :

FATAL EXCEPTION: main
java.lang.IllegalStateException: Fragment already added:
TestFragment{40856358 #0 id=0x7f060024 "myFragment"}
at android.app.BackStackRecord.doAddOp(BackStackRecord.java:322)
at android.app.BackStackRecord.add(BackStackRecord.java:316)
at com.mypackage.test.MyActivity.onTabSelected(MyActivity.java:164)

does the isAdded() function works fine ?

( used with android 3.1, it happens when leaving the app in pause
state, then resume it and change Tab from the action bar. )

any cu

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate