我尝试通过调用流动意图,使我的 Google Glass 可在我的应用程序中通过蓝牙被发现:
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 120);
startActivity(discoverableIntent);
但我收到以下错误消息:
无法开始活动
组件信息{com.example.glass/com.example.MainActivity}:
android.content.ActivityNotFoundException:找不到要处理的活动
意图 { act=android.bluetooth.adapter.action.REQUEST_DISCOVERABLE
(有额外内容)` }
有谁知道谷歌眼镜现在是否支持这个意图?
当然,我确保在清单文件中设置了权限:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
发生该错误的原因是 Glass 没有注册活动来处理显示该操作的 UI。
您可以在以下位置提交功能请求吗我们的问题跟踪器 https://code.google.com/p/google-glass-api/issues/list如果你需要这个?
与此同时,您是否探索过解决方法这个帖子/答案 https://stackoverflow.com/a/20414642/307266看看它是否适合你?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)