2
I created a Notification but it always compresses and goes down, I would like to leave it always expanded and always at the top of notifications
2
I created a Notification but it always compresses and goes down, I would like to leave it always expanded and always at the top of notifications
2
Just add the flag Notification.FLAG_ONGOING_EVENT in his Notification.
suaNotificacao.flags = Notification.FLAG_ONGOING_EVENT;
If you want to add more than one flag to your Notification, utilize |= to assign, for example:
suaNotificacao.flags |= Notification.FLAG_ONGOING_EVENT;
suaNotificacao.flags |= Notification.FLAG_SHOW_LIGHTS;
If you are using NotificationCompat.Builder, you can use the method setOngoing():
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
mBuilder.setOngoing(true);
even so it still gets compressed when comes something like the Whatsapp or something like that
Browser other questions tagged android android-notification
You are not signed in. Login or sign up in order to post.
Hi Aleff, can you post the code here? It’s easier ; )
– Fabricio
Try
notification.flags |= Notification.FLAG_ONGOING_EVENT;and/ornotification.priority = Notification.PRIORITY_MAX;– ramaral
even so it still gets compressed when comes something like the Whatsapp or something like that
– Aleff Matos