IllegalStateException: Fragment not added in ActionBarTabs example

by Ed Burnette » Fri, 20 May 2011 02:29:06 GMT


Sponsored Links
 While writing an app that uses Fragments and tabs on the Action Bar I
ran into a crash. I went back to the API Demos sample and can make the
same crash happen there. Start the program in the emulator and select
App > Action Bar > Action Bar Tabs. Click "Toggle tab mode" then "Add
new tab" twice, then click back and forth between the two tabs very
quickly until it crashes. Here's the traceback:


05-19 18:16:06.668: ERROR/AndroidRuntime(1153): FATAL EXCEPTION: main
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):
java.lang.IllegalStateException: Fragment not added:
TabContentFragment{407c55a8 #0 id=0x7f08000c Tab 1}
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.app.BackStackRecord.remove(BackStackRecord.java:366)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
com.example.android.apis.app.ActionBarTabs
$TabListener.onTabUnselected(ActionBarTabs.java:94)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
com.android.internal.app.ActionBarImpl.selectTab(ActionBarImpl.java:
476)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
com.android.internal.app.ActionBarImpl
$TabImpl.select(ActionBarImpl.java:816)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
com.android.internal.widget.ActionBarView
$TabClickListener.onClick(ActionBarView.java:954)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.view.View.performClick(View.java:3110)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.view.View$PerformClick.run(View.java:11928)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.os.Handler.handleCallback(Handler.java:587)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.os.Handler.dispatchMessage(Handler.java:92)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.os.Looper.loop(Looper.java:132)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
android.app.ActivityThread.main(ActivityThread.java:4025)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
java.lang.reflect.Method.invoke(Method.java:491)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
05-19 18:16:06.668: ERROR/AndroidRuntime(1153):     at
dalvik.system.NativeStart.main(Native Method)
05-19 18:16:06.698: WARN/ActivityManager(82):   Force finishing
activity com.example.android.apis/.app.ActionBarTabs

Is this a known problem? I tried it under SDK Platform 3.0 (rev 1) and
3.1 (rev 2).

-- 



Re: IllegalStateException: Fragment not added in ActionBarTabs example

by Shane Isbell » Fri, 20 May 2011 02:46:46 GMT


 I've run into this on occasion, I surrounded it with a general Exception
catch to handle this, which seemed to have no side affects for my
application, as to whether this is platform bug, who knows? Without the
source code to look at, it is anyone's guess.

Shane





-- 


Sponsored Links


Other Threads

1. Two touchscreen drivers in sapphire and trout phone



No, all this shows is that the driver supports hardware with _either_
of these configurations.

And yes, it probably would work if you had devices with both types
of configurations on the same system, but then you would have two
different instances of the device in the system.  But odds are, that
is not in a phone :)

Hope this helps,

greg k-h

2. Segfault in what looks like WebView

Hey guys, we just launched a new game (Super Game Pack) in the market, and
got a segfault on a 1.6 emulator...

there any way to track it further, or figure out exactly what's causing it?
Its relatively rare, so its a bit tough to reproduce, but if I have a way to
trace it, at least we'll be prepared when it does happen :)

11-03 19:40:48.630: INFO/DEBUG(539): *** *** *** *** *** *** *** *** *** ***
*** *** *** *** *** ***
11-03 19:40:48.640: INFO/DEBUG(539): Build fingerprint:
'generic/sdk/generic/:1.6/
DRC76/13852:eng/test-keys'
11-03 19:40:48.640: INFO/DEBUG(539): pid: 820, tid: 832  >>>
com.chickenbrickstudios.sgp <<<
11-03 19:40:48.640: INFO/DEBUG(539): signal 11 (SIGSEGV), fault addr
00000000
11-03 19:40:48.640: INFO/DEBUG(539):  r0 00000007  r1 411b9d58  r2 411b9d58
r3 00000000
11-03 19:40:48.640: INFO/DEBUG(539):  r4 411b9d58  r5 001d84a8  r6 00000000
r7 45c51ba4
11-03 19:40:48.640: INFO/DEBUG(539):  r8 45c51da0  r9 42491f54  10 42491f40
fp 00000001
11-03 19:40:48.640: INFO/DEBUG(539):  ip ad083e5c  sp 45c51b40  lr ad047361
pc ad03fc86  cpsr 00000030
11-03 19:40:48.650: DEBUG/webviewglue(820): nativeDestroy view: 0x3fa080
11-03 19:40:48.921: INFO/DEBUG(539):          #00  pc 0003fc86
/system/lib/libdvm.so
11-03 19:40:48.970: INFO/DEBUG(539):          #01  pc 0002f480
/system/lib/libdvm.so
11-03 19:40:48.970: INFO/DEBUG(539):          #02  pc 001f3c3a
/system/lib/libwebcore.so
11-03 19:40:48.970: INFO/DEBUG(539):          #03  pc 00260be6
/system/lib/libwebcore.so
11-03 19:40:48.990: INFO/DEBUG(539):          #04  pc 00260c48
/system/lib/libwebcore.so
11-03 19:40:48.990: INFO/DEBUG(539):          #05  pc 001c7df2
/system/lib/libwebcore.so
11-03 19:40:48.990: INFO/DEBUG(539):          #06  pc 001c21aa
/system/lib/libwebcore.so
11-03 19:40:48.999: DEBUG/webviewglue(820): nativeDestroy view: 0x41b440
11-03 19:40:49.030: INFO/DEBUG(539):          #07  pc 001aac9a
/system/lib/libwebcore.so
11-03 19:40:49.040: INFO/DEBUG(539):          #08  pc 001aaa60
/system/lib/libwebcore.so
11-03 19:40:49.040: INFO/DEBUG(539):          #09  pc 001ac094
/system/lib/libwebcore.so
11-03 19:40:49.040: INFO/DEBUG(539):          #10  pc 001ac2c2
/system/lib/libwebcore.so
11-03 19:40:49.040: INFO/DEBUG(539):          #11  pc 001a9bc2
/system/lib/libwebcore.so
11-03 19:40:49.061: INFO/DEBUG(539):          #12  pc 001c6166
/system/lib/libwebcore.so
11-03 19:40:49.061: INFO/DEBUG(539):          #13  pc 001c61e2
/system/lib/libwebcore.so
11-03 19:40:49.061: INFO/DEBUG(539):          #14  pc 00256b62
/system/lib/libwebcore.so
11-03 19:40:49.061: INFO/DEBUG(539):          #15  pc 0000e434
/system/lib/libdvm.so
11-03 19:40:49.071: INFO/DEBUG(539):          #16  pc 00040b0e
/system/lib/libdvm.so
11-03 19:40:49.071: INFO/DEBUG(539):          #17  pc 00013198
/system/lib/libdvm.so
11-03 19:40:49.110: INFO/DEBUG(539):          #18  pc 00017be4
/system/lib/libdvm.so
11-03 19:40:49.110: INFO/DEBUG(539):          #19  pc 0001762c
/system/lib/libdvm.so
11-03 19:40:49.110: INFO/DEBUG(539):          #20  pc 0005282c
/system/lib/libdvm.so
11-03 19:40:49.110: INFO/DEBUG(539):          #21  pc 0005284a
/system/lib/libdvm.so
11-03 19:40:49.120: INFO/DEBUG(539):          #22  pc 00047800
/system/lib/libdvm.so
11-03 19:40:49.120: INFO/DEBUG(539):          #23  pc 0000f940
/system/lib/libc.so
11-03 19:40:49.120: INFO/DEBUG(539):          #24  pc 0000f4b4
/system/lib/libc.so
11-03 19:40:49.120: INFO/DEBUG(539): stack:
11-03 19:40:49.120: INFO/DEBUG(539):     45c51b00  45c51b38
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b04  001d84a8  [heap]
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b08  4182712a
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b0c  4182712b
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b10  001d84a8  [heap]
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b14  00000001
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b18  00000007
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b1c  4106ffe0
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b20  001d84a8  [heap]
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b24  00000001
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b28  00000007
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b2c  ad047361
/system/lib/libdvm.so
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b30  411b9d58
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b34  001d84a8  [heap]
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b38  df002777
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b3c  e3a070ad
11-03 19:40:49.130: INFO/DEBUG(539): #00 45c51b40  3f800000
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b44  ad06c89c
/system/lib/libdvm.so
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b48  ad03ff19
/system/lib/libdvm.so
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b4c  ad06c610
/system/lib/libdvm.so
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b50  4377c458
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b54  ad06c610
/system/lib/libdvm.so
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b58  ad03fc71
/system/lib/libdvm.so
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b5c  001e9830  [heap]
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b60  00000000
11-03 19:40:49.130: INFO/DEBUG(539):     45c51b64  ad02f483
/system/lib/libdvm.so
11-03 19:40:49.140: INFO/DEBUG(539): #01 45c51b68  ad06c610
/system/lib/libdvm.so
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b6c  ad02ff11
/system/lib/libdvm.so
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b70  45c51ba4
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b74  411b9d58
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b78  001e9830  [heap]
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b7c  ad02f409
/system/lib/libdvm.so
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b80  00311988  [heap]
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b84  00000000
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b88  001e9830  [heap]
11-03 19:40:49.140: INFO/DEBUG(539):     45c51b8c  aa1f3c3d
/system/lib/libwebcore.so
11-03 19:40:52.673: INFO/ActivityManager(573): Process
com.chickenbrickstudios.sgp (pid 820) has died.
11-03 19:40:52.680: INFO/WindowManager(573): WIN DEATH: Window{437e0268
com.chickenbrickstudios.sgp/com.chickenbrickstudios.sgp.SuperGamePack
paused=false}
11-03 19:40:52.690: INFO/WindowManager(573): WIN DEATH: Window{438500c0
SurfaceView paused=false}
11-03 19:40:52.801: WARN/UsageStats(573): Unexpected resume of
com.android.launcher while already resumed in com.chickenbrickstudios.sgp
11-03 19:40:52.840: DEBUG/Zygote(541): Process 820 terminated by signal (11)
11-03 19:40:52.971: WARN/InputManagerService(573): Got RemoteException
sending setActive(false) notification to pid 820 uid 10023

Any Ideas?

- Dan

-- 

3. info: USA gets crazy about Nexus One

4. USB Tether dns resolve issue

5. apps: aTumblr

6. Two touchscreen drivers in sapphire and trout phone

7. NPAPI support in Android 2.0 SDK WebView