谷歌玻璃GDK:蓝牙发现意向 [英] Google Glass GDK: Bluetooth discoverable Intent
问题描述
我尽量让通过蓝牙我的谷歌玻璃发现在我的应用程序通过调用流动的意图:
意图discoverableIntent =新意图(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,120);
startActivity(discoverableIntent);
不过,我得到以下错误信息:
无法启动活动
ComponentInfo {} com.example.glass/com.example.MainActivity:
android.content.ActivityNotFoundException:无活动处理
意向{行动= android.bluetooth.adapter.action.REQUEST_DISCOVERABLE
(有临时演员)`}
块引用>有谁知道这个意图是由谷歌玻璃,现在还是不支持?
当然,我确信,我设置的权限在我的清单文件:
<使用许可权的android:NAME =android.permission.BLUETOOTH/>
<使用许可权的android:NAME =android.permission.BLUETOOTH_ADMIN/>
解决方案这是错误发生,因为玻璃没有注册的处理显示针对该操作的用户界面的一项活动。
你能文件中我们的问题跟踪如果你需要这个?
在此期间,你有没有探讨了解决方法这个帖子/应答来看看它是否会为你工作?
I try to make my Google Glass discoverable via Bluetooth in my app by calling the flowing intent:
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 120); startActivity(discoverableIntent);
But I get the following error message:
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)` }
Does anyone know if this intent is supported by Google Glass right now or not?
Of course I made sure that I set the permissions in my Manifest file:
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
解决方案That error is occurring because Glass does not have an activity registered to handle displaying the UI for that action.
Can you file a feature request in our issue tracker if you need this?
In the meantime, have you explored the workaround in this post/answer to see if it would work for you?
这篇关于谷歌玻璃GDK:蓝牙发现意向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!