String category = query.getString(3);
notificationItem.setCategory(category);
int order = query.getInt(4);
+ String phoneNum = query.getString(5);
+ notificationItem.setPhone(phoneNum);
notificationItem.setOrder(order);
- long date = query.getLong(5);
+ long date = query.getLong(6);
notificationItem.setDate(date);
ICLogger.d("notificationItem == > " +
notificationItem.toString());
//如果数量大于1,就显示通知界面
query.close();
}
+ handleTopIcons();
});
}
- public void removeNotificationByCategory(String category, String title) {
- executorService.execute(() -> {
- int delete;
- if (TextUtils.isEmpty(title)) {
- delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS),
- "category=?",
- new String[]{category});
- } else {
- delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS),
- "category=? and title=?",
- new String[]{category, title});
- }
- ICLogger.d("deleted == > " + delete);
- });
+ private void handleTopIcons() {
+
//根据类型修改顶部的值
//如果是短信
- Map<String, Integer> tempMap = new HashMap<>();
List<NotificationItem> value = notificationListValue.getValue();
+ if (value == null) {
+ return;
+ }
+ Map<String, Integer> tempMap = new HashMap<>();
for (int i = 0; i < value.size(); i++) {
NotificationItem notificationItem = value.get(i);
String itemCategory = notificationItem.getCategory();
contentResolver.insert(Uri.parse(Constants.SETTINGS), contentValues);
}
}
+
+ public void removeNotificationByCategory(String category, String title) {
+ executorService.execute(() -> {
+ int delete;
+ if (TextUtils.isEmpty(title)) {
+ delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS),
+ "category=?",
+ new String[]{category});
+ } else {
+ delete = contentResolver.delete(Uri.parse(Constants.NOTIFICATIONS),
+ "category=? and title=?",
+ new String[]{category, title});
+ }
+ ICLogger.d("deleted == > " + delete);
+ });
+ updateData();
+ }
}