private void cancelNotifications(){
  final NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  nm.cancel(NOTIFICATION_ID);
  final List<BluetoothDevice> managedDevices=getManagedDevices();
  for (  final BluetoothDevice device : managedDevices) {
    nm.cancel(device.getAddress(),NOTIFICATION_ID);
  }
}

private void cancelNotifications ( ) { final NotificationManager nm = ( NotificationManager ) getSystemService ( NOTIFICATION_SERVICE ) ; nm . cancel ( NOTIFICATION_ID ) ; final List < BluetoothDevice > managedDevices = getManagedDevices ( ) ; for ( final BluetoothDevice device : managedDevices ) { nm . cancel ( device . getAddress ( ) , NOTIFICATION_ID ) ; } }
cancels the existing notification . if there is no active notification this method does nothing
