I am preparing an extension to work with Bluetooth. In that, i am using the following code to Turn On Bluetooth.
if (!myBluetoothAdapter.isEnabled()) {
Intent myIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
activity.startActivityForResult(myIntent, 0);
}
Obviously, it shows a dialog box asking the user permission to ALLOW or DENY !
Now, the question is that: How do we know which button is pressed by the user ?
The code has to catch the user response: either ALLOW button is pressed or DENY button is pressed.
I am requesting the community help in this regard.
Thank you.