Auto enable Bluetooth error
<p>i use the simple program to write apps, i change the program from this:</p>

<pre><code>public void onStart() {
    super.onStart();
    if(D) Log.e(TAG, "++ ON START ++");

    // If BT is not on, request that it be enabled.
    // setupChat() will then be called during onActivityResult
    if (!mBluetoothAdapter.isEnabled()) {
        Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
        startActivityForResult(enableIntent, REQUEST_ENABLE_BT);

    // Otherwise, setup the chat session
    }else {
        if (mChatService == null) setupChat();
    }
}
</code></pre>

<p>to this:</p>

<pre><code>public void onStart() {
    super.onStart();
    if(D) Log.e(TAG, "++ ON START ++");

    // If BT is not on, request that it be enabled.
    // setupChat() will then be called during onActivityResult
    /*if (!mBluetoothAdapter.isEnabled()) {
        Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
        startActivityForResult(enableIntent, REQUEST_ENABLE_BT);*/
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
        if (!mBluetoothAdapter.isEnabled())
            mBluetoothAdapter.enable();
    // Otherwise, setup the chat session
    else {
        if (mChatService == null) setupChat();
    }
}
</code></pre>

<p>when i turn on the apps, the bluetooth can auto turn on but the apps will close, what can i do?</p>
