繁体   English   中英

TensorFlowlite 对象检测演示应用程序活动(Android Studio)不会启动

[英]TensorFlowlite Object detection demo app activity(Android studio) won't launch

仅在单击按钮时才尝试通过启动 DetectorActivity(执行检测的主要活动)来调整应用程序。 因此,在源代码中,我添加了一个“Main Activity”类,将其设置为清单中的启动活动,并在它的 xml 中添加了一个按钮,单击该按钮时,应向 DetectorActivity 发送一个意图并启动它。 代码几乎是这样的:

 protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void on(View v){
        Intent i = new Intent(this,DetectorActivity.class);
        startActivity(i);
    }

然而,该活动从未启动,这很令人费解。 这是模拟器的logcat:

 I/art: Ignoring second debugger -- accepting and dropping
12-21 20:39:13.111 23543-23550/.abc I/art: Ignoring second debugger -- accepting and dropping
12-21 20:39:13.563 23543-23543/.abc W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
12-21 20:39:13.745 23543-23554/abc I/art: Background sticky concurrent mark sweep GC freed 9521(535KB) AllocSpace objects, 0(0B) LOS objects, 75% free, 950KB/3MB, paused 8.576ms total 187.364ms
12-21 20:39:14.110 23543-23543/abc I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
12-21 20:39:14.112 23543-23543/.abc I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
12-21 20:39:15.082 23543-23577/abc D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
12-21 20:39:15.338 23543-23577/.abc I/OpenGLRenderer: Initialized EGL, version 1.4
12-21 20:39:15.338 23543-23577/abc W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
12-21 20:39:15.387 23543-23577/abc D/EGL_emulation: eglCreateContext: 0x7f758dd74f40: maj 2 min 0 rcv 2
12-21 20:39:15.403 23543-23577/abc D/EGL_emulation: eglMakeCurrent: 0x7f758dd74f40: ver 2 0 (tinfo 0x7f758dd532a0)
12-21 20:39:15.777 23543-23577/abc D/EGL_emulation: eglMakeCurrent: 0x7f758dd74f40: ver 2 0 (tinfo 0x7f758dd532a0)
12-21 20:39:16.102 23543-23543/abc I/Choreographer: Skipped 56 frames!  The application may be doing too much work on its main thread.
12-21 20:57:47.896 23543-23550/abc I/art: Ignoring second debugger -- accepting and dropping
12-21 20:57:47.909 23543-23550/abc I/art: Ignoring second debugger -- accepting and dropping
12-21 21:00:48.853 23543-23550/abc I/art: Ignoring second debugger -- accepting and dropping

在这方面的任何帮助将不胜感激!

你是如何设置点击监听器的? 这个日志表明它没有被调用。

@RyanMentley 的评论解决了这个问题,非常感谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM