我尝试通过调用流动 Intent 让我的 Google Glass 在我的应用程序中通过蓝牙被发现:
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 120);
startActivity(discoverableIntent);
但是我收到以下错误信息:
Unable to start activity ComponentInfo{com.example.glass/com.example.MainActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.bluetooth.adapter.action.REQUEST_DISCOVERABLE (has extras)` }
有谁知道谷歌眼镜现在是否支持这个 Intent ?
当然,我确保我在 list 文件中设置了权限:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
最佳答案
发生该错误是因为 Glass 没有注册 Activity 来处理显示该操作的 UI。
您可以在 our issue tracker 中提交功能请求吗?如果你需要这个?
与此同时,您是否探索了 this post/answer 中的解决方法?看看它是否适合您?
关于android - 谷歌眼镜 GDK : Bluetooth discoverable Intent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22820680/