Android的BluetoothSocket调用Close时程序崩溃

E次奥 2012-08-14 04:59:08
RT.

/* 停止客户端连接 */
private void shutdownClient() {
new Thread() {
public void run() {
if (clientConnectThread != null) {
clientConnectThread.interrupt();
Log.i("1111111111111111111111111111111",
"5555555555555555555555555555555555");
clientConnectThread = null;
}
if (mreadThread != null) {
mreadThread.interrupt();
Log.i("1111111111111111111111111111111",
"44444444444444444444444444444");
mreadThread = null;

}
if (socket != null) {
try {

socket.close(); Log.i("1111111111111111111111111111111",
"3333333333333333333333333");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

socket = null;
}
};
}.start();
}


走到Close方法时,程序崩溃退出了。什么错都没报!
...全文
243 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
无聊的影子 2014-11-23
  • 打赏
  • 举报
回复
同样问题,程序不会退出,不过不会执行下条语句,程序飞了。。。。。。
kaishenglong 2014-10-20
  • 打赏
  • 举报
回复
我也遇到这个奇葩的问题,请问楼主解决了吗,求解!
qq_21942255 2014-10-13
  • 打赏
  • 举报
回复
我也遇到这个问题,大神们能不能说详细一点
小样样 2014-07-10
  • 打赏
  • 举报
回复
我的程序也出现了这个问题,楼主现在解决了吗?
E次奥 2012-08-15
  • 打赏
  • 举报
回复
08-15 10:42:56.069: E/BluetoothEventLoop.cpp(187): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/248/hci0/dev_00_11_03_16_00_86
08-15 10:42:58.942: I/BootReceiver(187): Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
08-15 10:42:58.982: E/InputDispatcher(187): channel '40722518 ckx.androidbluetooth/ckx.androidbluetooth.Bluetooth (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-15 10:42:58.982: E/InputDispatcher(187): channel '40722518 ckx.androidbluetooth/ckx.androidbluetooth.Bluetooth (server)' ~ Channel is unrecoverably broken and will be disposed!
08-15 10:42:59.002: I/ActivityManager(187): Process ckx.androidbluetooth (pid 1925) has died.
08-15 10:42:59.002: I/WindowManager(187): WIN DEATH: Window{40722518 ckx.androidbluetooth/ckx.androidbluetooth.Bluetooth paused=false}
08-15 10:42:59.172: W/InputManagerService(187): Got RemoteException sending setActive(false) notification to pid 1925 uid 10061


close方法执行时出现的Log。。。是什么问题啊。。。
hvk687 2012-08-15
  • 打赏
  • 举报
回复
你这个应该是搞了一个monitor thread在监听其余的线程吧,建议加锁进行操作。不要直接这样close,或者判断数据。
E次奥 2012-08-15
  • 打赏
  • 举报
回复
有人遇到过这样的问题么,请教一下!
E次奥 2012-08-15
  • 打赏
  • 举报
回复
有人能看懂log的帮下啊。程序闪退了!

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧