-1

Possible Duplicate:
How to enable/disable bluetooth programmatically in android

Hi I m developing an application in which Bluetooth has to be turned on programatically can you please tell me as to how to do that step by step thanks in advance

Community
  • 1
  • 1
Rahul
  • 1
  • 1

1 Answers1

3

This code works for me. You can try this

  BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();    
        if (!mBluetoothAdapter.isEnabled()) {
           //Play with bluetooth
        }else{ 
            mBluetoothAdapter.disable(); 
        } 
Chris
  • 1,311
  • 2
  • 15
  • 37