use of com.odysee.app.tasks.lbryinc.NotificationDeleteTask in project odysee-android by OdyseeTeam.
the class MainActivity method handleDeleteSelectedNotifications.
private void handleDeleteSelectedNotifications(List<LbryNotification> notifications) {
List<Long> remoteIds = new ArrayList<>();
for (LbryNotification notification : notifications) {
remoteIds.add(notification.getRemoteId());
}
(new AsyncTask<Void, Void, Void>() {
protected Void doInBackground(Void... params) {
try {
SQLiteDatabase db = dbHelper.getWritableDatabase();
DatabaseHelper.deleteNotifications(notifications, db);
} catch (Exception ex) {
// pass
}
return null;
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new NotificationDeleteTask(remoteIds).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
if (notificationListAdapter != null) {
notificationListAdapter.removeNotifications(notifications);
}
if (actionMode != null) {
actionMode.finish();
}
}
Aggregations