Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notification.bigContentView is deprecated in API 24 (Nougat) what is the alternative?

I just upgraded compile sdk version to API 24 from API 23 and it seems the Notification.bigContentView is deprecated.

So the question what is the equivalent method in API 24 to set bigContentView in Android API 24(Nougat)?

like image 726
JAAD Avatar asked Aug 28 '16 08:08

JAAD


1 Answers

The NotificationBuilderCompat has a new method setCustomBigContentView() in the v4 support library 24.

You can use this method to avoid the deprecated warning and the method is backward compatible.

Quoting the Docs:

As of N, this field may be null. The expanded notification view is determined by the inputs to Notification.Builder; a custom RemoteViews can optionally be supplied with setCustomBigContentView(RemoteViews).

https://developer.android.com/reference/android/app/Notification.html#bigContentView

like image 122
JAAD Avatar answered Oct 23 '22 06:10

JAAD