diff --git a/app/src/main/java/com/keylesspalace/tusky/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/NotificationsFragment.java index e6350e4b..5e0f3f20 100644 --- a/app/src/main/java/com/keylesspalace/tusky/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/NotificationsFragment.java @@ -15,6 +15,7 @@ package com.keylesspalace.tusky; +import android.app.NotificationManager; import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -70,6 +71,14 @@ public class NotificationsFragment extends SFragment implements super.onDestroy(); } + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + NotificationManager notificationManager = + (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE); + notificationManager.cancel(PullNotificationService.NOTIFY_ID); + super.onCreate(savedInstanceState); + } + @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, diff --git a/app/src/main/java/com/keylesspalace/tusky/PullNotificationService.java b/app/src/main/java/com/keylesspalace/tusky/PullNotificationService.java index 292cc2cd..f3be9f6d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/PullNotificationService.java +++ b/app/src/main/java/com/keylesspalace/tusky/PullNotificationService.java @@ -57,7 +57,7 @@ import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class PullNotificationService extends IntentService { - private static final int NOTIFY_ID = 6; // This is an arbitrary number. + static final int NOTIFY_ID = 6; // This is an arbitrary number. private static final String TAG = "PullNotifications"; // logging tag and Volley request tag public PullNotificationService() {