Questions tagged [android-notification.mediastyle]

Notification style for media playback notifications. They are used to display previews of the media playing, i.e. music, videos, etc.

Notification style for media playback notifications. In the expanded form, Notification#bigContentView, up to 5 Notification.Actions specified with Notification.Builder#addAction(Action) will be shown as icon-only pushbuttons, suitable for transport controls.

More info about it:

https://developer.android.com/reference/android/app/Notification.MediaStyle

27 questions
12
votes
2 answers

RemoteServiceException when notification style is applied on Xiaomi phones with Android 11

Without any visible reason, Xiaomi phones with Android 11 started to appear in crashlytics logs. Something happens with notifications. We don't do anything too specific and everything works fine on other Android 11 devices. I wasn't able to…
10
votes
2 answers

Android Notification MediaStyle Ignores Ongoing Flag

I am attempting to employ a MediaStyle notification in an audio Android application as discussed in the audio app documentation as well as in the media style documentation. I am able to successfully show a notification with functional transport…
10
votes
0 answers

Youtube iframe api: interact with MediaSession

I have an angular app with the Youtube IFrame API. When the website/pwa is used on an android device, and a Youtube video is playing, the app automatically creates a notification in the android notification tray, allowing you to see what video is…
7
votes
5 answers

Mediastyle notifications not working in android 11

My custom mediastyle notification no longer works in Android 11 for my music app. It works fine in Android 10 and previous versions. Is there any other code I need to add so that it works in Android 11. I should add that getting rid of the "…
janu935
  • 71
  • 1
  • 4
6
votes
1 answer

Android: NotificationCompat.MediaStyle action buttons don't do anything

I've got a simple Android app containing one Activity and a Service that derives from MediaBrowserServiceCompat. I've successfully gotten it set up to play audio from my main activity by using MediaBrowserCompat and MediaControllerCompat. It can…
4
votes
1 answer

Android MediaStyle Notification image (largeIcon) is pixilated

I'm trying to show a media style notification, and I'm grabbing the image for the art from my app's local files directory by Uri. When the same exact same image is shown in my app (via coil's AsyncImage) it displays in perfect quality, but when the…
4
votes
1 answer

How to get seekable progressbar in your notification that updates your mediaplayer instance in android q programatically?

Android Q and above provides functionality to include seek-able progress bar in our notification. I am creating a app that plays audio files from external storage. MediaPlayer control progressbar I want to implement the progress bar as shown in the…
3
votes
1 answer

How to get callback when MediaStyle notification is dismissed when onGoing is set to true?

I am displaying notification with following code: val notification = NotificationCompat.Builder(this, AudioNotificationHandler.CHANNEL_ID) .setContentTitle("abc") .setSmallIcon( R.drawable.ic_certyylogo …
3
votes
0 answers

Playing ExoPlayer in foreground

I use ExoPlayer with standard PlayerNotificationManager class from library. When I close my app that playing music with swipe, Android fully kill it, music stopped, notification continues to be displayed, but buttons isn't active. Can I implement…
2
votes
1 answer

Update MediaStyle notification of a foreground service without POST_NOTIFICATIONS permission via NotificationManager.notify in Android 13

My app targets API 33, and runs a foreground service to play online music. Once the notification is started via startForeground(notification_Id, notification) I can update the notification via notificationManager.notify(notification_Id,…
2
votes
1 answer

Custom Android notification sound

I'm trying to implement a custom notification sound in my application. I have written the following code, but the application plays only default sound and not the custom sound i've added in raw folder. Upon receiving the notification, the logs…
2
votes
1 answer

Using setProgress in notification builder not working with Media Style Notification

I'm trying to use .setProgress() on a NotificationBuilder but it seems the pogressBar won't appear if I use MediaStyle: NotificationCompat.Builder builder = new NotificationCompat.Builder(this,CHANNEL); builder .setSmallIcon(R.drawable.logo) //…
1
vote
0 answers

Small Icon in MediaStyle Notification not shown

I'm using MediaStyle notification. the notification symbol (smallIcon) isn't displayed in Android >= 11 when MediaStyle is enabled. As I disable MediaStyle, then the symbol is shown. Permissions are set:
1
vote
0 answers

Samsung Music Controls Widget not working properly

I have a working app with notification media controls. I am properly using Notification.MediaStyle(). Everything works well on Google Pixel 4a. However Samsung devices are showing their own system/default controls on lock screen. Buttons are wrong,…
Matej Košút
  • 590
  • 2
  • 10
  • 27
1
vote
0 answers

Load remote image to NotificationCompat MessagingStyle Message SetData in Android

I am trying to load image from a remote url in NotificationCompat.MessagingStyle.Message.setData() method. Code is like this val senderImg = Picasso.with(this).load(senderAvatar).get() val sndr = Person.Builder() …
1
2