Unable to resume activity with java.lang.IllegalArgumentException on Android api >=24
catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
"Unable to resume activity "
+ r.intent.getComponent().toShortString()
+ ": " + e.toString(), e);
}
}
it's a chained exeption so inspect e.getCause() stacktrace -> till cause will be null
if you'll not find it look at the method in activity thread which invokes try block:
try {
r.activity.onStateNotSaved();
r.activity.mFragments.noteStateNotSaved();
if (r.pendingIntents != null) {
deliverNewIntents(r, r.pendingIntents);
r.pendingIntents = null;
}
if (r.pendingResults != null) {
deliverResults(r, r.pendingResults);
r.pendingResults = null;
}
r.activity.performResume();
// If there is a pending local relaunch that was requested
// when the activity was
// paused, it will put the activity into paused state
// when it finally happens.
// Since the activity resumed before being relaunched,
// we don't want that to happen,
// so we need to clear the request to relaunch paused.
for (int i = mRelaunchingActivities.size() - 1; i >= 0; i--) {
final ActivityClientRecord relaunching =
mRelaunchingActivities.get(i);
if (relaunching.token == r.token
&& relaunching.onlyLocalRequest &&
relaunching.startsNotResumed) {
relaunching.startsNotResumed = false;
}
}
}
you'll need to search for reason in:
- Activity.onStateNotSaved();
- Activity.mFragments.noteStateNotSaved();
- Activity.performResume();
- and final Activity.onNewIntent()
Caused by java.lang.IllegalArgumentException
at android.os.Parcel.readException(Parcel.java:1697)
at android.os.Parcel.readException(Parcel.java:1646)
at android.app.ActivityManagerProxy.isTopOfTask (ActivityManagerNative.java:6600)
at android.app.Activity.isTopOfTask(Activity.java:6142)
at android.app.Activity.onResume(Activity.java:1331)
and best shot it's an answer for this issue:
rjava.lang.IllegalArgumentException on startActivity(intent,bundle animantion)