Code example for BluetoothAdapter

Methods: getStateisEnabled

0
	public static boolean enableAdapter(Activity invokerActivity) {
		if (D)
			if(D)Log.e(TAG, "++ enableAdapter ++");
		if (btAdapter != null)
			if(D)Log.e(TAG, "btAdapter != null");
		if (!btAdapter.isEnabled()) {
			if (D)
				if(D)Log.d(TAG, "enabling adapter");
			Intent enableBtIntent = new Intent(
					BluetoothAdapter.ACTION_REQUEST_ENABLE);
			invokerActivity.startActivityForResult(enableBtIntent,
					REQUEST_ENABLE_BT);
		} 
		int state = btAdapter.getState();
		return state == BluetoothAdapter.STATE_TURNING_ON
				|| state == BluetoothAdapter.STATE_ON;
	} 
 
	public static boolean isEnabled() { 
		return btAdapter.isEnabled();
Stop searching for code, let great code find you!  Add Codota to your java IDE