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)?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With