Notifications In Moto Display
I created a notification and it works but not display in Moto Display when locked. I changed Priority, Category etc with no effects. I want this notification like messages or misse
Solution 1:
As pointed out by Marcin, Moto Display doesn't work with vector drawable in notification small icon. I had the same problem and changing the small icon resolved the issue.
It's sad that such a nice feature as Moto Display doesn't have a documentation pointing that out.
Solution 2:
Notificationnotification=newNotification.Builder(context)
// Show controls on lock screen even when user hides sensitive content.
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setSmallIcon(R.drawable.ic_stat_player)
// Add media control buttons that invoke intents in your media service
.addAction(R.drawable.ic_prev, "Previous", prevPendingIntent) // #0
.addAction(R.drawable.ic_pause, "Pause", pausePendingIntent) // #1
.addAction(R.drawable.ic_next, "Next", nextPendingIntent) // #2// Apply the media style template
.setStyle(newNotification.MediaStyle()
.setShowActionsInCompactView(1/* #1: pause button */)
.setMediaSession(mMediaSession.getSessionToken())
.setContentTitle("Wonderful music")
.setContentText("My Awesome Band")
.setLargeIcon(albumArtBitmap)
.build();
That worked in my Moto Z, maybe only work in Media mode.
Post a Comment for "Notifications In Moto Display"