最近,当CameraActivity调用onResume()时,我有时会遇到此异常。
java.lang.RuntimeException:Unable to resume activity {<pacakge name>/<package name>.activity.record.CameraActivity}: java.lang.IllegalArgumentException
android.app.ActivityThread.performResumeActivity(ActivityThread.java:3586)
......
Caused by:
java.lang.IllegalArgumentException:
android.os.Parcel.readException(Parcel.java:1669)
android.os.Parcel.readException(Parcel.java:1618)
android.app.ActivityManagerProxy.isTopOfTask(ActivityManagerNative.java:5516)
android.app.Activity.isTopOfTask(Activity.java:6203)
android.app.Activity.onResume(Activity.java:1307)
android.support.v4.app.FragmentActivity.onResume(FragmentActivity.java:485)
<package name>.activity.BaseActivity.onResume(BaseActivity.java:207)
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1279)
android.app.Activity.performResume(Activity.java:7017)
android.app.ActivityThread.performResumeActivity(ActivityThread.java:3561)
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3626)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1618)
android.os.Handler.dispatchMessage(Handler.java:105)
android.os.Looper.loop(Looper.java:156)
android.app.ActivityThread.main(ActivityThread.java:6523)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
public abstract class BaseActivity {
@Override
protected void onResume() {
super.onResume();
mIsResuming = true;
mAnchorPoint = null;
}
}
我想知道android 7.0上面的系统有时会抛出这样的异常的原因。我查了一些相关的参考资料但没有得到。
注意:仅在Android 7.0 +
上发生