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. Iptables

Hi,

I'm trying to develop a firewall for Android using the sdk, and I
understand the only way to do so using java and without modifying
Android itself is through iptables. There are some old comments in
this group that claim that iptables is no included in Android, but
after the release of the code, I checked and iptables is included
among the projects used in Andoid (maybe it has been a latter
addition). Therefore I assume that it can be used in Android.

My code tries to execute commands using a java Process, and so far it
seems to work,since I've been able to do an "ls", for example. But
when I use iptables I don't receive any result(after trying to block
all traffic I can still use the browser), or any error on the outputs
(I've checke both standard and error output). I don't know if that's
caused because I'm not using the command correctly, or because of a
lack of permissions, or because of the absence of iptables among
Android commands.

Does anyone have an idea about the reason for this? (I mean, if
someone knows for sure that iptables is not included, or that is
included but can only be used as an administrator, or any other reason
that is clearly preventing this from working...if there's no apparent
reason for it not to work, then I'll asume it's an error on my code or
in the command I'm trying to execute)

The commands I'm trying to use are:

iptables -F
iptables -X
iptables -Z
iptables -t nat -F

iptables -P INPUT DROP
iptables -P OUTPUT DROP

in order to block all traffic, and therefore see if it's working or
not in an easy way.

Thank you for your help

--~--~---------~--~----~------------~-------~--~----~

2. ImageView

Hi,
       I want to show set of images like Toast when i click on Button. it
should be like ..first Image then second n next and last and disappeared
.....

-- 
Thank & Regards
Peeyush Varshney

--~--~---------~--~----~------------~-------~--~----~

3. How to receive SDP from 200 OK in SIP in responce to INVITE

4. PNG quality in WebView based app

5. Help needed from someone with a Nexus S 2.3.2 system

6. invalid state problem in stagefright

7. Stop GPS request after pop last activity