Test if my device is discoverable on Android

Viewed 4525

I want to test if my android device is discoverable before sending the intent that prompts the user to turn it on, what do I do?

the intent is as follows:

Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 30);
startActivityForResult(intent, idBlueToothDiscoveryRequest);
1 Answers
Related