I'm looking for the way how to show notification on the Motorola X style, or other devices with Active Display functionality.
I've read whole internet, twice. No result. Default notification is not showing on active display. My base idea was to extend NotificationCompat with WearableExtender class. But notification is still only in tray/lockscreen, not on active display.
Current code:
NotificationCompat.WearableExtender wearableExtender =
new NotificationCompat.WearableExtender().setHintHideIcon(true);
// Create notification
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
.setContentIntent(contentIntent)
.setSmallIcon(getSmallIconId(context, intent))
.setColor(context.getResources().getColor(R.color.primary))
.setGroup(group)
.setNumber(count)
.setContentTitle(title)
.setContentText(message)
.setOnlyAlertOnce(true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setAutoCancel(true)
.setDefaults(NotificationCompat.DEFAULT_ALL)
.extend(wearableExtender);
// Show notification
NotificationManager mNotifyMgr =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotifyMgr.notify(id, notificationBuilder.build());
Does anyone know the trick?
Sometimes i really hate android. After 2 days i got a solution.
The solution is pretty simple, you have to call:
.setGroupSummary(true)
and notification finally appears.