I have an application that checks every 30 seconds to see if the user has a new PDF available based on their ids. I can create a notification for one, but when I create another notification for the other it overwrites the first. I want there to be a separate notification for each id. I want it this way because I currently have it set so when the user clicks the notification it downloads the PDF according to the id associated with the notification. Is there a way to do this?
Asked
Active
Viewed 124 times
0
-
My bad I didnt think to search. By the way, if I responded to one of those would it 'bump' the question so others would see it as recent? – IT_Guy Nov 08 '13 at 17:43
-
1A comment won't bump, an answer or edit will. *Don't* edit just to bump it though, and if you add an answer, make sure it's an *answer*, rather than "I'm also having this problem." – Geobits Nov 08 '13 at 17:46
1 Answers
1
You need to give them unique ID numbers when you call notify(id, notification)
.
As a design issue, you might consider stacking them instead of filling up the notification bar. When clicked, you can go to a simple activity that lists available PDFs for download if there is more than one.

Geobits
- 22,218
- 6
- 59
- 103
-
Thanks thats exactly what I needed. Is there a disadvantage to not stacking them? They will have at most 4 alerts at once and I don't want want to have to deal with storing that window if the user accidentally clicks out of it. With my current system the user clicks on the notification, a window pops up saying "downloading pdf..."(user cannot hit physical back button to close window), the pdf is downloaded in the background, the pdf is opened with another application once downloaded, and then the loading window is closed/nullified in the background. Is that bad design? – IT_Guy Nov 08 '13 at 17:42
-
1It's just a design decision, not good or bad exactly. As a user, I'd prefer not having 4 notifications from the same app. If it's an internal company app, most likely nobody will care. If it's for market distribution, you might want to think it over. There's no one right or wrong answer. – Geobits Nov 08 '13 at 17:44