示例#1
0
  public static void saveLastNotificationActioned(Context context, String accountKey, long postId) {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    SharedPreferences.Editor edit = preferences.edit();
    edit.putLong(SHARED_PREFERENCES_KEY_NOTIFICATION_LAST_ACTIONED_MENTION_ID + accountKey, postId);
    edit.commit();

    Notifier.setDashclockValues(context, accountKey, 0, "");
  }
示例#2
0
  public static void cancel(Context context, String accountKey) {
    NotificationManager notificationManager =
        (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancel(accountKey.hashCode());

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    SharedPreferences.Editor edit = preferences.edit();
    edit.putInt(SHARED_PREFERENCES_KEY_NOTIFICATION_COUNT + accountKey, 0);
    edit.putString(SHARED_PREFERENCES_KEY_NOTIFICATION_SUMMARY + accountKey, "");
    edit.commit();

    Notifier.setDashclockValues(context, accountKey, 0, "");
  }