private void onBluetoothActionStateChanged(Context context,Intent intent){
  int currentState=intent.getIntExtra(BluetoothAdapter.EXTRA_STATE,DEFAULT_INT);
  int previousState=intent.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE,DEFAULT_INT);
  String currentStateString=getBTStateStringFromCode(currentState);
  String previousStateString=getBTStateStringFromCode(previousState);
  log.debug(String.format("BT state change. %s (%d) to %s (%d) ",previousStateString,previousState,currentStateString,currentState));
switch (currentState) {
case BluetoothAdapter.STATE_TURNING_OFF:
case BluetoothAdapter.STATE_OFF:
    showNoBluetoothNotification(context);
  break;
case BluetoothAdapter.STATE_TURNING_ON:
case BluetoothAdapter.STATE_ON:
dismissNoBluetoothNotification(context);
break;
}
}

private void onBluetoothActionStateChanged ( Context context , Intent intent ) { int currentState = intent . getIntExtra ( BluetoothAdapter . EXTRA_STATE , DEFAULT_INT ) ; int previousState = intent . getIntExtra ( BluetoothAdapter . EXTRA_PREVIOUS_STATE , DEFAULT_INT ) ; String currentStateString = getBTStateStringFromCode ( currentState ) ; String previousStateString = getBTStateStringFromCode ( previousState ) ; log . debug ( String . format ( "BT state change. %s (%d) to %s (%d) " , previousStateString , previousState , currentStateString , currentState ) ) ; switch ( currentState ) { case BluetoothAdapter . STATE_TURNING_OFF : case BluetoothAdapter . STATE_OFF : showNoBluetoothNotification ( context ) ; break ; case BluetoothAdapter . STATE_TURNING_ON : case BluetoothAdapter . STATE_ON : dismissNoBluetoothNotification ( context ) ; break ; } }
handler for events broadcast when the bluetooth radio is turning on / off , or has successfully turned on or off .
