Answer the question
In order to leave comments, you need to log in
Why Are Android Notifications Confused?
Hello
Please help me understand why notifications behave strangely.
I will describe: a notification comes from the group, but when you click on it, the wrong (other) group opens (ProfileActivity in the code).
Here is a link to the current code: https://pastebin.com/LuccdJnY
The correct data is leaving my server on FCM, there is no error here.
At first I thought that they were somehow mixed up in places, but also not, sometimes it opens correctly, and sometimes, just like that, it opens unexpected groups at all ......
I even replaced the notification ID generation with one that would definitely be unique but didn't help:
tag = String.valueOf(System.currentTimeMillis());
notificationManager.notify(tag, 0, notificationBuilder.build());
Intent intent = new Intent(this, ProfileActivity.class);
intent.putExtra(ProfileActivity.USER_ID_EXTRA_KEY, uId);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question