Android Wear Specific Notification

前端 未结 5 2025
醉话见心
醉话见心 2021-02-13 23:21

The WearableNotifications.Builder setLocalOnly method can be used for displaying a notification on a phone only, and not mirror it to a Wear device.

Is th

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 23:48

    There is a trick to add a notification for the wear device only.

    Add the notification to a group with NotificationCompat.Builder.setGroup and don't display a summary notification for this group. The phone will only display the summary notifications, since there isn't one nothing is displayed on the phone. Just create a random group string for every notification that should only be displayed on the phone.

提交回复
热议问题