S
S
synapse_people2020-02-12 16:10:29
Java
synapse_people, 2020-02-12 16:10:29

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());


Please help!

This code is most likely error-free:
Intent intent = new Intent(this, ProfileActivity.class);
intent.putExtra(ProfileActivity.USER_ID_EXTRA_KEY, uId);

She's probably here somewhere.
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT)


I don't know

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question