Is there any alternative to PRIORITY_MAX that is obsolete?

2

I'm using the NotificationCompat.Builder class to create a notification in which it has to stay on top with the highest priority.

I set the notification priority as follows:

notification.setPriority(Notification.PRIORITY_MAX);

However, Android Studio says that the PRIORITY_MAX field is deprecated .

Question

So, I would like to know if there is any alternative to PRIORITY_MAX and that is not deprecated or deprecated?

    
asked by anonymous 08.02.2018 / 02:21

1 answer

2

The method setPriority has become obsolete since API 26 and documentation it is recommended to use setImportance

You can use IMPORTANCE_HIGH instead of PRIORITY_MAX .

Below the values that you can enter as a parameter, these values are available from the API 24 .

08.02.2018 / 02:57