A
A
Alexander Afanasiev2014-03-21 16:02:10
Android
Alexander Afanasiev, 2014-03-21 16:02:10

Android: how to turn on bluetooth without confirmation?

Tell me how to programmatically turn on the bluetooth so that the user does not need to confirm the inclusion (see screenshot).
bt_enable_request.png
At the moment I turn on the bluetooth like this:

Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
byhtada, 2015-07-20
@byhtada

BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
btAdapter.enable();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question