Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 谷歌GDK和蓝牙可发现意图_Android_Bluetooth_Google Glass_Google Gdk - Fatal编程技术网

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" />
已经有一个问题没有答案。我发现了一个错误,但它不能解释为什么会发生这个错误。有什么想法吗