When I have run into this error, it is because I am trying to work
with a fragment that is no longer part of the activity (e.g., has been
replaced).

On Fri, Jan 13, 2012 at 3:14 AM, Teo Yan <[email protected]> wrote:
> Hi,
>
> I'm using a stability tool to test my app(my app is developed before
> ICS, but currently running on ICS), the tool is similar with the
> monkey. And this exception happen to me, but only 15% to reproduce.
>
> Here's the exception stack:
>
> java.lang.IllegalStateException: Can not perform this action after
> onSaveInstanceState
>        at
> android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:
> 1265)
>        at
> android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:
> 451)
>        at android.app.Activity.onBackPressed(Activity.java:2121)
>        at android.app.Activity.onKeyUp(Activity.java:2099)
>        at com.teo.SearchActivity.onKeyUp(SearchActivity.java:195)
>        at android.view.KeyEvent.dispatch(KeyEvent.java:2582)
>        at android.app.Activity.dispatchKeyEvent(Activity.java:2329)
>        at com.android.internal.policy.impl.PhoneWindow
> $DecorView.dispatchKeyEvent(PhoneWindow.java:1825)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at android.widget.TabHost.dispatchKeyEvent(TabHost.java:324)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1346)
>        at com.android.internal.policy.impl.PhoneWindow
> $DecorView.superDispatchKeyEvent(PhoneWindow.java:1898)
>        at
> com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:
> 1380)
>        at android.app.Activity.dispatchKeyEvent(Activity.java:2324)
>        at com.android.internal.policy.impl.PhoneWindow
> $DecorView.dispatchKeyEvent(PhoneWindow.java:1825)
>        at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:
> 3327)
>        at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:
> 3300)
>        at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2460)
>        at android.os.Handler.dispatchMessage(Handler.java:99)
>        at android.os.Looper.loop(Looper.java:137)
>        at android.app.ActivityThread.main(ActivityThread.java:4441)
>        at java.lang.reflect.Method.invokeNative(Native Method)
>        at java.lang.reflect.Method.invoke(Method.java:511)
>        at com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:807)
>        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:574)
>        at dalvik.system.NativeStart.main(Native Method)
>
> And the code block near line 195 in SearchActivity.java is here:
>    public boolean onKeyUp(int keyCode, KeyEvent event) {
>        if (mListManager.getCurrentList().onKeyUp(keyCode, event)) {
>            return true;
>        }
>        return super.onKeyUp(keyCode, event);  // Line 195
>    }
>
> And someone has the same problem with me:
> http://groups.google.com/group/android-developers/browse_thread/thread/74eacf9d7a32f8d3/cfaa7c0b89561f0e?lnk=gst&q=Can+not+perform+this+action+after+onSaveInstanceState#cfaa7c0b89561f0e
>
> but seems no approach in the above thread.
>
> Did this exception ever happen to you? If any, pls share your
> knowledge to me, thanks.
>
> BR/Teo
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 4.1 Available!

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

Reply via email to