【发布时间】:2011-08-20 16:55:56
【问题描述】:
当我不在活动中但在TimerTask(在Service 中创建)中尝试获取默认蓝牙适配器时,使用:
BluetoothAdapter.getDefaultAdapter();
我得到以下异常:
Exception while invoking java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
我的应用程序没有任何活动 - 那么有没有可能让这个适配器远离活动?
【问题讨论】:
-
查看 Android 对此错误的回复:code.google.com/p/android/issues/detail?id=16587
标签: android bluetooth runtimeexception