I'm also seeing an error like this:

*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.onKeyDown(Activity.java:2017)*
* at android.view.KeyEvent.dispatch(KeyEvent.java:2635)*
* at android.app.Activity.dispatchKeyEvent(Activity.java:2329)*
* at 
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1954)
*
* at 
android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3360)*
* at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3333)*
* at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2477)*
* at android.os.Handler.dispatchMessage(Handler.java:99)*
* at android.os.Looper.loop(Looper.java:137)*
* at android.app.ActivityThread.main(ActivityThread.java:4514)*
* 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:790)
*
* at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)*
* at dalvik.system.NativeStart.main(Native Method)*

However, I'm not explicitly working with fragments at all.

Any ideas what's going on?

Thanks.



On Sunday, January 29, 2012 7:45:48 PM UTC-6, Teo Yan wrote:
>
> Thx Murphy. 
>
> I try to fix it by like this: 
>
> boolean activityActive = true; 
>
> protected void onResume() { 
>     // do something 
>     activityActive = true; 
> } 
>
> protected void onPause() { 
>    // do something 
>    activityActive = false; 
> } 
>
> public boolean onKeyUp(int keyCode, KeyEvent event)  { 
>    if (!activityActive) { 
>       return false; 
>   } 
>   // do something 
> } 
>
> public boolean onKeyDown(int keyCode, KeyEvent event) { 
>    if (!activityActive) { 
>       return false; 
>   } 
>   // do something 
> }

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to