androidandroid-notificationswear-osandroid-wear-notification

Show notification only on phone (not on Android Wear)


Is there any way to prevent a notification be shown on Android Wear device? I know it's possible by using setOngoing(true) but I don't want my notification to be ongoing.


Solution

  • you should call setLocalOnly(true) on the NotificationCompat.Builder.

    From the documentation

    Set whether or not this notification should not bridge to other devices.

    you can read more here