-1

Do you know which method I am supposed to use to create a permanent Notification using NotificationChannel in Android Pie? More precisely, a notification that the user cant remove.

Bazouk55555
  • 557
  • 6
  • 24

1 Answers1

2

If I understand correctly your question than your permanent notification is called ongoing notification.

You can use

setOngoing(true)

for your

NotificationCompat.Builder

However this question seems to be duplicated: please see more here:

Android: How to create an "Ongoing" notification?

  • 1
    No because I am talking about NotificationCHannel which is not the case in the question you show – Bazouk55555 Mar 14 '19 at 07:59
  • 1
    Notification Channels are created before you send notifications via that channel, for that sending you probably still would use NotificationCompat where you can use setOngoing. Or you mean you would like all notifications of a channel to be ongoing? I am not sure if that is possible with Android SDK As far as I know you have to set it individually for each notifications. – Krisztián Vizsy Mar 14 '19 at 08:06
  • Ha ok! Thank you for your reply! – Bazouk55555 Mar 14 '19 at 08:21