Android 谷歌GDK和蓝牙可发现意图
我正在制作一个应用程序,通过蓝牙从智能手机向谷歌眼镜发送数据。我遵循了相同的场景,并尝试了以下方法。这是在谷歌眼镜上运行的:Android 谷歌GDK和蓝牙可发现意图,android,bluetooth,google-glass,google-gdk,Android,Bluetooth,Google Glass,Google Gdk,我正在制作一个应用程序,通过蓝牙从智能手机向谷歌眼镜发送数据。我遵循了相同的场景,并尝试了以下方法。这是在谷歌眼镜上运行的: Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 120); startActivity(discov
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)` }
我已通过以下方式设置在清单上使用蓝牙的权限:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
已经有一个问题没有答案。我发现了一个错误,但它不能解释为什么会发生这个错误。有什么想法吗