From 5118ab3cbf47a6a3981216909ee1973ef04507df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Thu, 5 Mar 2020 16:20:25 +0100 Subject: [PATCH] Fix notifications not click-able --- android/app/src/main/AndroidManifest.xml | 2 +- .../simplecloudnotifier/service/NotificationService.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4894d79..4cd6f1c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -62,7 +62,7 @@ android:name=".view.debug.QueryLogActivity" android:label="@string/title_activity_query_log" android:theme="@style/AppTheme" /> - + \ No newline at end of file diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/service/NotificationService.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/service/NotificationService.java index 5c8b64f..044396f 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/service/NotificationService.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/service/NotificationService.java @@ -229,10 +229,10 @@ public class NotificationService if (msg.Priority == PriorityEnum.NORMAL) mBuilder.setPriority(NotificationCompat.PRIORITY_DEFAULT); if (msg.Priority == PriorityEnum.HIGH) mBuilder.setPriority(NotificationCompat.PRIORITY_HIGH); - Intent intnt_click = new Intent(SCNApp.getContext(), BroadcastReceiverService.class); - intnt_click.putExtra(BroadcastReceiverService.ID_KEY, BroadcastReceiverService.NOTIF_SHOW_MAIN); - PendingIntent pi = PendingIntent.getBroadcast(ctxt, 0, intnt_click, 0); + Intent intent = new Intent(ctxt, MainActivity.class); + PendingIntent pi = PendingIntent.getActivity(ctxt, 0, intent, 0); mBuilder.setContentIntent(pi); + NotificationManager mNotificationManager = (NotificationManager) ctxt.getSystemService(Context.NOTIFICATION_SERVICE); if (mNotificationManager == null) return;