I am working with Google's Leanback library for Android TV and I am trying to figure out how to best listen for the buttons on the remote control (especially the ones that are not captured by the MediaSession
).
我正在为安卓电视的谷歌的Leanback图书馆工作,我正试图弄清楚如何最好地监听遥控器上的按钮(特别是那些没有被MediaSession捕获的按钮)。
For that reason I have a break point in BaseGridView.dispatchTouchEvent()
and when I press one of the remote buttons the debugger does indeed jump to that point and shows me the usual debug information.
出于这个原因,我在BaseGridView.dispatchTouchEvent()中有一个断点,当我按下其中一个远程按钮时,调试器确实会跳转到那个断点,并向我显示通常的调试信息。
However, after a few (2-5) seconds the debug info disappears and is replaced by the message "Frame is not available".
然而,几秒钟后,调试信息就消失了,取而代之的是消息“框架不可用”。
In other places the debugger is working fine, so I was wondering whether the delay caused by the debugger is counted as ANR and the app is therefore force closed?
在其他地方调试器运行良好,我想知道调试器造成的延迟是否被算作ANR,因此app*关闭?
In any case, is there any way to get around this?
无论如何,有什么方法可以解决这个问题吗?
4 个解决方案
#1
3
This message appears because u set too many breakpoints, and threads are waiting data from other threads, to settle this, you could cancel some breakpoints and waiting for the data to be ready...
出现此消息是因为u设置了太多的断点,并且线程正在等待来自其他线程的数据,为了解决这个问题,您可以取消一些断点并等待数据准备就绪……
#2
2
the message "frames not available" means that no more frames are available for debugging. The android studio help states clearly the purpose of the frame window and the frames within:
消息“框架不可用”意味着没有更多的框架可用来调试。android studio帮助明确说明框架窗口和框架的目的:
The Frames pane enables you to gain access to the list of threads of your application , export to a text file and customize thread presentation. For each thread, you can view the stack frame, examine frames, navigate between frames, and automatically jump to a frame's source code in the editor. You can select a thread via a the thread selector drop-down list on top of the pane. The status and type of a thread is indicated by a special icon and a textual note next to the thread's name.
框架窗格使您能够访问应用程序的线程列表、导出到文本文件和自定义线程表示。对于每个线程,您可以查看堆栈框架、检查框架、在框架之间导航,并在编辑器中自动跳转到框架的源代码。您可以通过面板顶部的thread selector下拉列表选择一个线程。线程的状态和类型由一个特殊的图标和线程名称旁边的文本注释来指示。
So now that you have no frames available means all frames are closed for debugging. Might be due to app being force closed or misbehaving at that line in any way. Try debugging the statement after which this happens to get rid of this behaviour. Hope it helps
因此,既然没有可用的框架,那么所有的框架都将关闭以进行调试。可能是由于app被强制关闭或在这条线上做错了什么。尝试调试语句,在此语句之后,该语句恰好可以消除这种行为。希望它能帮助
#3
1
Having the same issue, restarting AS works for me.
有同样的问题,重新开始对我来说是可行的。
#4
0
When you get the message "frames not available" it means that no more frames are available for debugging. The frames are part of Android Studio's debugging which gives you access to the list of threads running in your application. It is the long list of processes you see in the debugging window. So what is happening is that Android Studio loses knowledge of the threads it had before you set the breakpoint when you are stepping out. This might be happening in your case because by default when you set a breakpoint, it stops execution of all threads. When you step out, the threads that follow rely on the threads before to work which is what closes the app. Since you are setting your breakpoint at getCurrentDetails, my best assumption is that it did not get the response from OKHttp in time since it is happening in a background thread. You can try two things to get it to work. First, try and right click on the breakpoint and change the breakpoint from pausing all threads to just that thread. This should allow OKHttp to get the response in time before being cut off. Or, shift your breakpoint further down and see if it works.
当您得到消息“框架不可用”时,这意味着没有更多的框架可用来调试。这些框架是Android Studio调试的一部分,允许您访问在应用程序中运行的线程列表。它是在调试窗口中看到的一长串进程。正在发生的是,Android Studio失去了在你退出之前设置断点之前的线程的知识。这种情况可能会发生,因为默认情况下,当您设置断点时,它将停止所有线程的执行。走出时,线程按照依赖线程之前的工作就是关闭程序。因为你在getCurrentDetails设置断点,我最好的假设是,它没有及时响应从OKHttp因为它发生在一个后台线程。你可以尝试两件事来让它工作。首先,尝试右键单击断点,将断点从暂停所有线程改为只暂停该线程。这应该允许OKHttp在被切断之前及时得到响应,或者将断点进一步向下移动,看看它是否有效。
#1
3
This message appears because u set too many breakpoints, and threads are waiting data from other threads, to settle this, you could cancel some breakpoints and waiting for the data to be ready...
出现此消息是因为u设置了太多的断点,并且线程正在等待来自其他线程的数据,为了解决这个问题,您可以取消一些断点并等待数据准备就绪……
#2
2
the message "frames not available" means that no more frames are available for debugging. The android studio help states clearly the purpose of the frame window and the frames within:
消息“框架不可用”意味着没有更多的框架可用来调试。android studio帮助明确说明框架窗口和框架的目的:
The Frames pane enables you to gain access to the list of threads of your application , export to a text file and customize thread presentation. For each thread, you can view the stack frame, examine frames, navigate between frames, and automatically jump to a frame's source code in the editor. You can select a thread via a the thread selector drop-down list on top of the pane. The status and type of a thread is indicated by a special icon and a textual note next to the thread's name.
框架窗格使您能够访问应用程序的线程列表、导出到文本文件和自定义线程表示。对于每个线程,您可以查看堆栈框架、检查框架、在框架之间导航,并在编辑器中自动跳转到框架的源代码。您可以通过面板顶部的thread selector下拉列表选择一个线程。线程的状态和类型由一个特殊的图标和线程名称旁边的文本注释来指示。
So now that you have no frames available means all frames are closed for debugging. Might be due to app being force closed or misbehaving at that line in any way. Try debugging the statement after which this happens to get rid of this behaviour. Hope it helps
因此,既然没有可用的框架,那么所有的框架都将关闭以进行调试。可能是由于app被强制关闭或在这条线上做错了什么。尝试调试语句,在此语句之后,该语句恰好可以消除这种行为。希望它能帮助
#3
1
Having the same issue, restarting AS works for me.
有同样的问题,重新开始对我来说是可行的。
#4
0
When you get the message "frames not available" it means that no more frames are available for debugging. The frames are part of Android Studio's debugging which gives you access to the list of threads running in your application. It is the long list of processes you see in the debugging window. So what is happening is that Android Studio loses knowledge of the threads it had before you set the breakpoint when you are stepping out. This might be happening in your case because by default when you set a breakpoint, it stops execution of all threads. When you step out, the threads that follow rely on the threads before to work which is what closes the app. Since you are setting your breakpoint at getCurrentDetails, my best assumption is that it did not get the response from OKHttp in time since it is happening in a background thread. You can try two things to get it to work. First, try and right click on the breakpoint and change the breakpoint from pausing all threads to just that thread. This should allow OKHttp to get the response in time before being cut off. Or, shift your breakpoint further down and see if it works.
当您得到消息“框架不可用”时,这意味着没有更多的框架可用来调试。这些框架是Android Studio调试的一部分,允许您访问在应用程序中运行的线程列表。它是在调试窗口中看到的一长串进程。正在发生的是,Android Studio失去了在你退出之前设置断点之前的线程的知识。这种情况可能会发生,因为默认情况下,当您设置断点时,它将停止所有线程的执行。走出时,线程按照依赖线程之前的工作就是关闭程序。因为你在getCurrentDetails设置断点,我最好的假设是,它没有及时响应从OKHttp因为它发生在一个后台线程。你可以尝试两件事来让它工作。首先,尝试右键单击断点,将断点从暂停所有线程改为只暂停该线程。这应该允许OKHttp在被切断之前及时得到响应,或者将断点进一步向下移动,看看它是否有效。