Clear notifications on open app (#93)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.github.gotify.messages;
|
package com.github.gotify.messages;
|
||||||
|
|
||||||
|
import android.app.NotificationManager;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@@ -284,6 +285,12 @@ public class MessagesActivity extends AppCompatActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
||||||
|
Context context = getApplicationContext();
|
||||||
|
NotificationManager nManager =
|
||||||
|
((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE));
|
||||||
|
nManager.cancelAll();
|
||||||
|
|
||||||
IntentFilter filter = new IntentFilter();
|
IntentFilter filter = new IntentFilter();
|
||||||
filter.addAction(WebSocketService.NEW_MESSAGE_BROADCAST);
|
filter.addAction(WebSocketService.NEW_MESSAGE_BROADCAST);
|
||||||
registerReceiver(receiver, filter);
|
registerReceiver(receiver, filter);
|
||||||
|
|||||||
Reference in New Issue
Block a user