Currently i am working on a Bluetooth app where i need to change the Scan Mode from SCAN_MODE_CONNECTABLE_DISCOVERABLE to SCAN_MODE_CONNECTABLE on click of a button.
i am setting it Discoverable using following Intent:
Intent discoverableIntent = new Intent( BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent .putExtra( BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, DISOVERABLE_DURATION);
startActivityForResult(discoverableIntent, REQUEST_DISCOVERABLE_BT);
where i have set DISOVERABLE_DURATION=300;
Now i want to skip the Discoverability in between and want to change its state to SCAN_MODE_CONNECTABLE only.
Kindly provide me an appropriate solution../
Start a new intent with SCAN_MODE_NONE to stop scanning and then start again with SCAN_MODE_CONNECTABLE to scan again in connectable mode only.