From 20768182209001d9a7bd6a3d1f3be5548395f5a3 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Wed, 11 Jan 2023 11:19:30 -0300 Subject: [PATCH] Now its fixed for good. That was easier than I thought --- .../src/main/java/org/joinmastodon/android/MainActivity.java | 2 +- .../org/joinmastodon/android/PushNotificationReceiver.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java b/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java index 9e1072833..22a2f9a5c 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java +++ b/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java @@ -57,7 +57,7 @@ public class MainActivity extends FragmentStackActivity{ fragment.setArguments(args); showFragmentClearingBackStack(fragment); if(intent.getBooleanExtra("fromNotification", false) && intent.hasExtra("notification")){ - Notification notification=Parcels.unwrap(intent.getParcelableExtra("notification"+intent.getParcelableExtra("notificationID"))); + Notification notification=Parcels.unwrap(intent.getParcelableExtra("notification")); showFragmentForNotification(notification, session.getID()); }else if(intent.getBooleanExtra("compose", false)){ showCompose(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index 0d1f1bb85..a667f8ea1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -136,12 +136,12 @@ public class PushNotificationReceiver extends BroadcastReceiver{ contentIntent.putExtra("accountID", accountID); contentIntent.putExtra("notificationID", notificationID); if(notification!=null){ - contentIntent.putExtra("notification" + notificationID, Parcels.wrap(notification)); + contentIntent.putExtra("notification", Parcels.wrap(notification)); } builder.setContentTitle(pn.title) .setContentText(pn.body) .setStyle(new Notification.BigTextStyle().bigText(pn.body)) - .setContentIntent(PendingIntent.getActivity(context, accountID.hashCode() & 0xFFFF, contentIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT)) + .setContentIntent(PendingIntent.getActivity(context, notificationID, contentIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT)) .setWhen(notification==null ? System.currentTimeMillis() : notification.createdAt.toEpochMilli()) .setShowWhen(true) .setCategory(Notification.CATEGORY_SOCIAL)