how to auto enable bluetooth base on the android simple code?
<p>This is the code that I'm trying to use. Could you please tell me what the problem is with it??</p>

<p>My code:</p>

<pre><code>    public void onStart() {
    super.onStart();
    if(D) Log.e(TAG, "++ ON START ++");
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
          if (!mBluetoothAdapter.isEnabled()) {

          }else{
               mBluetoothAdapter.enable(); 
          } ;
    } {
        if (mChatService == null) setupChat();

}
</code></pre>
