Google Glass GDK: Bluetooth discoverable Intent

元气小坏坏 提交于 2019-12-12 16:00:15

问题


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" />

回答1:


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?



来源:https://stackoverflow.com/questions/22820680/google-glass-gdk-bluetooth-discoverable-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!