AdvancedAndroid_ClassicalMusicQuiz icon indicating copy to clipboard operation
AdvancedAndroid_ClassicalMusicQuiz copied to clipboard

Problem with NotificationCompat.MediaStyle() for API Level 26 (Oreo) and beyond

Open ambageo opened this issue 7 years ago • 2 comments

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()

ambageo avatar Jun 02 '18 14:06 ambageo

#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.

ambageo avatar Jun 02 '18 14:06 ambageo

This won't work in Android 26+ you must create channel

LuisVargasVic avatar Oct 15 '19 20:10 LuisVargasVic