活动没叫finish?(API 23) [英] Activity did not call finish? (API 23)

查看:49
本文介绍了活动没叫finish?(API 23)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误,我不知道为什么会发生这种情况.

I am getting the following error and i have no clue as to why its happening.

错误:

08-23 17:07:46.533  22454-22454/com.a.b.c E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.a.b.c, PID: 22454
    java.lang.RuntimeException: Unable to resume activity {com.a.b.c/com.a.b.c.MainActivity}: java.lang.IllegalStateException: Activity {com.a.b.c/com.a.b.c.MainActivity} did not call finish() prior to onResume() completing
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
            at android.app.ActivityThread.-wrap11(ActivityThread.java)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     Caused by: java.lang.IllegalStateException: Activity {com.a.b.c/com.a.b.c.MainActivity} did not call finish() prior to onResume() completing
            at android.app.Activity.performResume(Activity.java:6324)
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
            at android.app.ActivityThread.-wrap11(ActivityThread.java)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

代码:

protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
    System.out.println("Started");
}

我正在尝试在运行 android 6.0 (API 23) 的 AVD 上运行代码,适用于 API 22.

I am trying to run the code on an AVD running android 6.0 (API 23), works on API 22.

推荐答案

这是 Android M 开发者预览版中的一个错误.更多详情

This is a bug in Android M developer preview. More details

这篇关于活动没叫finish?(API 23)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆