Code example for BluetoothAdapter

Methods: enable

0
         
        new AsyncTask<Void, Void, Void>() {
            @Override 
            protected Void doInBackground(Void... args) {
                if (status == 1)
                    mBluetoothAdapter.enable();
                else 
                    mBluetoothAdapter.disable();
                return null; 
            } 
        }.execute();
    } 
 
    protected int getDrawableIcon() { 
        int status = mPreferenceState;
 
        switch (status) {
            case 0: return 0x7f020102; 
            case 1: return 0x7f020101; 
        }