如果未恢复家长活动,则无法开始孩子活动

时间:2019-05-06 07:29:59

标签: android android-activity

当我开始活动时:java.lang.RuntimeException:java.lang.RuntimeException:无法恢复活动

 Intent intent = new Intent();
 intent.setClassName(context, "xxxx.MainFrameActivity");
 startActivity(intent);

---android.util.AndroidRuntimeException: Activity could not be started for Intent { cmp=/.MainFrameActivity }
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1970)
android.app.Instrumentation.execStartActivity(Instrumentation.java:1617)
android.app.Activity.startActivityForResult(Activity.java:4472)
android.support.v4.app.BaseFragmentActivityApi16.void startActivityForResult(android.content.Intent,int,android.os.Bundle)(BaseFragmentActivityApi16.java:54)
android.support.v4.app.FragmentActivity.void startActivityForResult(android.content.Intent,int,android.os.Bundle)(FragmentActivity.java:67)
android.app.Activity.startActivityForResult(Activity.java:4430)
android.support.v4.app.FragmentActivity.void startActivityForResult(android.content.Intent,int)(FragmentActivity.java:720)
android.app.Activity.startActivity(Activity.java:4791)
android.app.Activity.startActivity(Activity.java:4759)

1 个答案:

答案 0 :(得分:0)

尝试一下:

Intent intent = new Intent(Activity_n.this, Activity_1.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);