本文介绍了谷歌玻璃GDK:蓝牙发现意向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尽量让通过蓝牙我的谷歌玻璃发现在我的应用程序通过调用流动的意图:

 意图discoverableIntent =新意图(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,120);
startActivity(discoverableIntent);

不过,我得到以下错误信息:

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:蓝牙发现意向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 05:44