How to highlight a list item when a notification arrives

327 views Asked by At

I am creating a project in which I want to highlight a list item background when a notification arrives. I have done a thing in it but nothing is working perfectly.I am briefing my case:

Case 1: In first I have done that I have saved order id in shared preference based on notification and run loop to check that list contains that id and highlight that background but sometimes it is creating problem. Can anyone suggest me any other option.

1

There are 1 answers

1
Ramesh On

In the onMessageReceived() i.e. when notification came from the server. Simply pass the Intent with extras, In the onResume() of the activity get the extras of the intent. Update adapter according to the extras. Finally simply call the notifyDatasetchange().