Code example for BluetoothAdapter

Methods: isEnabled

0
     * Start the chat service. Specifically start AcceptThread to begin a 
     * session in listening (server) mode. Called by the Activity onResume() */ 
    public synchronized void start() { 
 
        if (D) Log.d(TAG, "start");
        if (!mAdapter.isEnabled()) {
            setState(STATE_NONE);
            return; 
        } 
        // Cancel any thread attempting to make a connection 
        if (mConnectThread != null) {
            mConnectThread.cancel();
            mConnectThread = null;
        } 
        // Cancel any thread currently running a connection 
        if (mConnectedThread != null) {
            mConnectedThread.cancel();
            mConnectedThread = null;
        } 
        setState(STATE_LISTEN);
    }