From b1ee4111e2d4e1cbf02ed0259aa4234875eda32f Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 1 Sep 2020 14:51:20 +0700 Subject: [PATCH] fix(android/engine): Dismiss notification when touched --- .../java/com/tavultesoft/kmea/logic/ResourcesUpdateTool.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/logic/ResourcesUpdateTool.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/logic/ResourcesUpdateTool.java index 8b95ce3d9a..8629fc57b2 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/logic/ResourcesUpdateTool.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/logic/ResourcesUpdateTool.java @@ -148,7 +148,7 @@ public class ResourcesUpdateTool implements KeyboardEventHandler.OnKeyboardDownl channel.setDescription(description); // Register the channel with the system; you can't change the importance // or other notification behaviors after this - NotificationManager notificationManager = aContext.getSystemService(NotificationManager.class); + NotificationManager notificationManager = (NotificationManager) aContext.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.createNotificationChannel(channel); } } @@ -428,6 +428,7 @@ public class ResourcesUpdateTool implements KeyboardEventHandler.OnKeyboardDownl .setContentTitle(currentContext.getString(R.string.keyboard_updates_available)) .setContentText(message) .setPriority(NotificationCompat.PRIORITY_DEFAULT) + .setAutoCancel(true) .setContentIntent(startUpdateIntent) .setOngoing(true);