Code example for BluetoothAdapter

Methods: disablegetState

0
	} 
 
	public static boolean disableAdapter() { 
		if (D)
			if(D)Log.e(TAG, "++ disableAdapter ++");
		if (btAdapter.getState() == BluetoothAdapter.STATE_OFF) {
			return true; 
		} else { 
			btAdapter.disable();
		} 
		int state = btAdapter.getState();
		return state == BluetoothAdapter.STATE_TURNING_OFF
				|| state == BluetoothAdapter.STATE_OFF;
	} 
 
	public static void makeDiscoverable(MainActivity invokerActivity) {
		if (D)
			if(D)Log.e(TAG, "++ makeDiscoverable ++");
		Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
		intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);