简体   繁体   English

bulkTransfer使应用程序崩溃

[英]bulkTransfer makes the application crash

I'm developing app for connecting arduino to Android. 我正在开发用于将arduino连接到Android的应用程序。 Everything's working correctly, 一切正常
but I've faced a problem: 但我遇到了一个问题:

When I'm getting data from the arduino it makes the program to crash. 当我从arduino获取数据时,它会使程序崩溃。

I'm getting data using bulkTransfer and in a Runnable thread every 2milliseconds. 我每隔2毫秒使用bulkTransfer和Runnable线程获取数据。

Any help, Thanks in advance! 任何帮助,在此先感谢!

My problem was that I wanted to access the UI thread inside a runnable thread and it causes the app to crash. 我的问题是我想访问可运行线程中的UI线程,这会导致应用崩溃。 Lessening interaction with GUI solved my problem. 减少与GUI的交互解决了我的问题。

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

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