Problem: 
When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.putExtra() to save the notificationId in the intent. But, for multiple notifications its overwriting the notificationId and returns the latest one. I dont understand as to why this is happening and how can i avoid this overwriting of notificationId. 

Answer: 
I got the answer. The intents were getting cached in. To, make a new intent, just add the following piece of code: 

1 intent.setData((Uri.parse("custom://"+System.currentTimeMillis())));

This makes the intent unique. 
Also, someone suggested me the following piece of code to make the intent unique: 

1 intent.setAction("actionstring" + System.currentTimeMillis());

It didnt help me, but might be of help to someone else.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-09-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-16
  • 2021-11-07
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
相关资源
相似解决方案