Android Wear特定通知

Ste*_*eve 12 android android-notifications wear-os

WearableNotifications.Builder setLocalOnly方法可用于仅在手机上显示通知,并且它不是镜像到Wear装置.

有没有办法做相反的事情,所以创建一个只会在Wear设备上显示的通知?

小智 2

实际上,您可以在可穿戴通知上使用.setMinPriority()来完成此操作(虽然不是官方的,但目前可以使用)

 Notification summaryNotification = new WearableNotifications.Builder(builderG)
        .setGroup(GROUP_KEY_MESSAGES, WearableNotifications.GROUP_ORDER_SUMMARY)
        .setMinPriority() 
        .build();
Run Code Online (Sandbox Code Playgroud)