Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/news-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/NotificationActionReceiver.java')
-rw-r--r--News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/NotificationActionReceiver.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/NotificationActionReceiver.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/NotificationActionReceiver.java
index 43672dc9..13663682 100644
--- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/NotificationActionReceiver.java
+++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/NotificationActionReceiver.java
@@ -4,8 +4,11 @@ import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.os.Build;
import android.util.Log;
+import androidx.annotation.RequiresApi;
+
import org.greenrobot.eventbus.EventBus;
import de.luhmer.owncloudnewsreader.database.DatabaseConnectionOrm;
@@ -17,6 +20,7 @@ import static de.luhmer.owncloudnewsreader.Constants.NOTIFICATION_ACTION_MARK_AL
public class NotificationActionReceiver extends BroadcastReceiver {
private static final String TAG = NotificationActionReceiver.class.getCanonicalName();
+ @RequiresApi(api = Build.VERSION_CODES.O)
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
@@ -26,7 +30,7 @@ public class NotificationActionReceiver extends BroadcastReceiver {
dbConn.markAllItemsAsRead();
EventBus.getDefault().post(new SyncFinishedEvent());
- Integer notificationId = intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1);
+ int notificationId = intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1);
if (notificationId != -1) {
NotificationManager nMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nMgr.cancel(notificationId);