Sartheris Stormhammer
Sartheris Stormhammer

Reputation: 2564

Foreground service notification can't show up, too many things

I have a foreground service notification for my app, but for some phones, where they have too many things in the notification area it does not show up. Is there some way I can increase the priority of my app, so it shows up first? Right now its like this, my app is not thereenter image description here

Upvotes: 1

Views: 270

Answers (1)

AADProgramming
AADProgramming

Reputation: 6335

Try couple of things.
1. set the parameter "when" which is A timestamp related to this notification, to notification object with a future time.

notification.when = System.currentTimeMills()*2;

2. issue notification with PRIORITY_MAX while posting the notification.

notification.priority = Notification.PRIORITY_MAX;

This PRIORITY_MAX ensures that the notification you are sending from your application is Highest priority, for your application's most important items that require the user's prompt attention or input.

But note that priority field that App can set is only indicates Relative priority for this notification. Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification.

And below line from Android docs makes things pretty clear.

The system will make a determination about how to interpret this priority when presenting the notification.

Upvotes: 1

Related Questions