Open top menu


Example - How to check Bluetooth Off Or On

<uses-permission android:name="android.permission.BLUETOOTH" />

private boolean getBlueToothOn(Context context) {
    BluetoothAdapter btAdapter = ((Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR1)
            ? ((BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter()
            : (BluetoothAdapter.getDefaultAdapter()));

    if (btAdapter == null) {
        return false;
    }
    if (btAdapter.getState() == BluetoothAdapter.STATE_ON) {
        return true;
    }
}
Tagged

1 comment:

  1. Blackjack, Cards and Jacks - Mapyro
    Blackjack, Cards and Jacks. Mapyro. Your closest casino, this 하남 출장마사지 one is located 순천 출장마사지 in the 전주 출장마사지 West Village East Village, 용인 출장샵 just a 구리 출장샵 couple of blocks from

    ReplyDelete