How do I open the Bluetooth Settings Activity programmatically? How do I open the Bluetooth Settings Activity programmatically? android android

How do I open the Bluetooth Settings Activity programmatically?


Maybe I missed something but isn't this simpler future proof solution?

Intent intentOpenBluetoothSettings = new Intent();intentOpenBluetoothSettings.setAction(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS); startActivity(intentOpenBluetoothSettings); 

It is definitely not possible to "remove" the other settings. On phones just one category of settings is shown. On tablets, because of some extra space, settings are shown in master-detail layout so there is no empty space on more the half of the tablet screen. This is how Android is designed and just by writing one app that can not be changed.

As suggested by @zelanix the BLUETOOTH_ADMIN permission in manifest is required.


I think you should try this easier one :

startActivity(new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS));


use

ComponentName cn = new ComponentName("com.android.settings",                    "com.android.settings.bluetooth.BluetoothSettings");

instead of

final ComponentName cn = new ComponentName("com.android.settings",                               "com.android.settings.bluetoothSettings");

to launch BluetoothSettings settings