private void updateSharedPreferencesEntry(int notificationId,boolean remove){
  Set<String> notificationIds=new HashSet<String>(mSharedPreferences.getStringSet(MEDIA_NOTIFICATION_IDS,new HashSet<String>()));
  if (remove && !notificationIds.isEmpty() && notificationIds.contains(String.valueOf(notificationId))) {
    notificationIds.remove(String.valueOf(notificationId));
  }
 else   if (!remove) {
    notificationIds.add(String.valueOf(notificationId));
  }
  SharedPreferences.Editor sharedPreferenceEditor=mSharedPreferences.edit();
  sharedPreferenceEditor.putStringSet(MEDIA_NOTIFICATION_IDS,notificationIds);
  sharedPreferenceEditor.apply();
}

private void updateSharedPreferencesEntry ( int notificationId , boolean remove ) { Set < String > notificationIds = new HashSet < String > ( mSharedPreferences . getStringSet ( MEDIA_NOTIFICATION_IDS , new HashSet < String > ( ) ) ) ; if ( remove && ! notificationIds . isEmpty ( ) && notificationIds . contains ( String . valueOf ( notificationId ) ) ) { notificationIds . remove ( String . valueOf ( notificationId ) ) ; } else if ( ! remove ) { notificationIds . add ( String . valueOf ( notificationId ) ) ; } SharedPreferences . Editor sharedPreferenceEditor = mSharedPreferences . edit ( ) ; sharedPreferenceEditor . putStringSet ( MEDIA_NOTIFICATION_IDS , notificationIds ) ; sharedPreferenceEditor . apply ( ) ; }
update shared preferences entry with ids of the visible notifications .
