Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent user from dismissing notification

Some apps have notifications which can´t be dismissed by swiping them away.

How can I manage such behaviour?

like image 619
Marian Klühspies Avatar asked Aug 27 '13 12:08

Marian Klühspies


People also ask

Which notification technique does not require user interaction?

Toast Notification This type of notification will be used when there is no need of user interaction on seeing this message.

How do I get rid of non removable notifications?

FLAG_NO_CLEAR or Notification. FLAG_ONGOING_EVENT is what you are looking for.

What is permanent notification?

A permanent notification is a (usually silent) alert displayed by certain apps on your Android smartphone or tablet at all times to let you know they're running in the background.


1 Answers

In addition to Andro Selvas answer:

If you are using the NotificationCompat.Builder, just use

builder.setOngoing(true); 
like image 120
Marian Klühspies Avatar answered Sep 24 '22 22:09

Marian Klühspies