android - 谷歌眼镜 GDK : Bluetooth discoverable Intent

标签 android android-intent bluetooth google-glass google-gdk

我尝试通过调用流动 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/

相关文章:

java - 整数不能转换为 Long

android - notifyDataSetChanged 不适用于 RecyclerView

java - Android:如何从蓝牙设备控制音乐服务播放/暂停?

java - 查询 Android 浏览器历史记录中的 URL

Android 在另一个 Activity 中导入 Intent 内容

java - 如何与 BLE 通信

android - 检索 GSM 网络信息 Android?

c++ - Linux 蓝牙 API 函数位置

linux - 无法在 bluetoothctl 上输入

c# - 动态更改 TextView 的文本