Problem with NotificationCompat.MediaStyle() for API Level 26 (Oreo) and beyond
I noticed that the MediaStyle notification isn't working when selecting the compileSdkVersion to 27. As I found in the following link, we must add the following import: import android.support.v4.media.app.NotificationCompat.MediaStyle; Additionally, in the showNotification() method, were we set the Style of the builder, we must do it in the following way: setStyle(new android.support.v4.media.app.NotificationCompat.MediaStyle()
#Edit: it seems that importing the android.support.v4.media.app.NotificationCompat.MediaStyle isn't necessary, so we only have to change the setStyle part. However, although the notification is shown, the notifications actions are not working.
This won't work in Android 26+ you must create channel