1

I'm making an app to send datas to my Google Glasses from my smartphone via Bluetooth. I've followed this issue (same scenario) and tried the following. This is running on the Google Glasses :

Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); 
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 120);
startActivity(discoverableIntent);

But I get this error :

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)` }

I've set up the permissions for using Bluetooth on my Manifest this way :

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

There is already an unanswered question. I've found an alternative to it, but it doesn't explains me why this error occurs. Any ideas ?

Community
  • 1
  • 1
Jacks
  • 587
  • 5
  • 28

0 Answers0