蓝牙连接异常,报错The application may be doing too much work on its main thread.

W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
W/System.err: java.io.IOException: read failed, socket might closed or timeout, read ret: -1
W/System.err:     at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:741)
W/System.err:     at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:753)
W/System.err:     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:375)
W/System.err:     at com.joey.bluetoothdemo.util.ClientUtil.connectToServer(ClientUtil.java:38)
W/System.err:     at com.joey.bluetoothdemo.MainActivity$1.onItemClick(MainActivity.java:96)
W/System.err:     at android.widget.AdapterView.performItemClick(AdapterView.java:310)
W/System.err:     at android.widget.AbsListView.performItemClick(AbsListView.java:1155)
W/System.err:     at android.widget.AbsListView$PerformClick.run(AbsListView.java:3148)
W/System.err:     at android.widget.AbsListView$3.run(AbsListView.java:4091)
W/System.err:     at android.os.Handler.handleCallback(Handler.java:754)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err:     at android.os.Looper.loop(Looper.java:163)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6342)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
D/ClientUtil: connectToServer: 蓝牙连接异常
I/Choreographer: Skipped 311 frames!  The application may be doing too much work on its main thread.
I/Toast: Show toast from OpPackageName:com.joey.bluetoothdemo, PackageName:com.joey.bluetoothdemo, content:选择 H-C-2010-06-01


问题:

原本想为蓝牙连接新开一个线程,但是方法调用时应该调用start()方法却错调用了run()

The application may be doing too much work on its main thread.
解决:

run改成start后异常解决


完~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值