当我在手机上快速按回、回、回时,出现以下异常:
java.lang.NullPointerException
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1378)
at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:437)
at android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:452)
at android.app.Activity.onBackPressed(Activity.java:2123)
at com.swipemaster.activities.CommonActivity.onBackPressed(CommonActivity.java:16)
at com.swipemaster.activities.MainActivity.access$0(MainActivity.java:1)
at com.swipemaster.activities.MainActivity$1.run(MainActivity.java:62)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
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:817)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
在 Android 4.0.4 和 2 设备上测试:Sony Xperia MT27i 和 ST23i。在 2.2.1 和 Galaxy Mini 上不会出现此问题。有谁能够帮助我?
CommonActivity
班级:
public class CommonActivity extends Activity
{
@Override
public void onBackPressed()
{
MusicPlayer.continueMusic = true;
super.onBackPressed(); // this is CommonActivity.java:16
}