位置: 编程技术 - 正文
推荐整理分享ANR 的一个触摸bug转载下。。点击就会出现 error 的bug。。(触摸按钮失灵怎么回事),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:触碰按钮,触摸按钮失灵修复小技巧,触摸ae,触碰按钮,触碰按钮,触碰按钮,触摸按钮失灵怎么回事,触摸按钮失灵怎么回事,内容如对您有帮助,希望把文章链接给更多的朋友!
转载
ANR: Application Not Responding (keyDispatchingTimedOut)This is a heads up for those Android developers that use the NDK (Native Development Kit) to write Android apps. If you are using the NDK, you are almost certainly using the glue code that Google provides in the android_native_app_glue.c file.
Chances are that in your Google Play Developer Console, you see reports of Application Not Responding (ANR keyDispatchingTimedOut.) For my app, I have of these reports on an installed base of 1.5M downloads. Consulting stackoverflow or other developer groups, will invariably yield the advice not to block the main thread. However, it is easy to cause this ANR without blocking the main thread, if you are using the android_native_app_glue.c file in your project.
If two events are generated at exactly the same time, using different sources or devices, the app will freeze. You can easily produce this with a PS3 controller hooked up to your Android device and depress both analogue sticks at exactly the same time, or release them at exactly the same time. If you do this while running an NDK based app, the app will freeze and issue an ANR.
It took me a day of debugging to find a work around for this, but I am happy to report that the following change to the glue code will stop the issue from happening. What you need to do is get events from the queue repeatedly in a loop, instead of just handling a single event in process_input() function.
I have reported the issue to Google.
Posted by Bram Stolk at 2: PMJavaScript简单抽奖程序的实现及代码 JavaScript简单抽奖程序的实现及代码1.需求说明某公司年终抽奖,需要有如下功能1)可以根据实际情况设置到场人数的最大2)点击开始,大屏幕滚动,点
android fragment中使用startActivityForResult细节 fragment中调用startActivityForResult时,前面不需要加入getActivity()方法。如果加入,那么在onActivityResult的回调方法中是无法接受到回调的内容。
JavaScript文件处理:文件读取 在我的前一篇blog中,我介绍了在JavaScript中如何使用文件,具体重点放在如何获得File对象。只有当用户通过上传或者拖拽的方式上传了文件,这些对象
标签: 触摸按钮失灵怎么回事
本文链接地址:https://www.jiuchutong.com/biancheng/374513.html 转载请保留说明!上一篇:android项目目录介绍之二(android工程目录)
下一篇:JavaScript简单抽奖程序的实现及代码(js数组随机抽奖)
友情链接: 武汉网站建设