Android wear not show notification

后端 未结 3 627
不思量自难忘°
不思量自难忘° 2020-12-19 21:03

I\'ve probblem. My android wear emulator not show notification. Here is my code for mobile:

private void notifyToWear() {
        NotificationCompat.Wearable         


        
相关标签:
3条回答
  • 2020-12-19 21:37

    Try this:

    NotificationCompact.Builder notBuilder = 
                                       new NotificationCompact.Builder(this);
    notBuilder.setContentTitle("Title").setContentText("Text");
    WearableNotifications.Builder wearBuilder = 
                                     new WearableNotifications.Builder(notBuilder);
    Notification not = wearBuilder.build();
    
    NotificationManagerCompat manager = NotificationManagerCompat.from(this);
    manager.notify(0,not);
    

    I hope this will help you..

    0 讨论(0)
  • 2020-12-19 21:39

    On Android 7, go to: Settings > Apps > click cogwheel > Special Access > Notification access > Android Wear > click switch for Tasker. See screenshot.

    0 讨论(0)
  • 2020-12-19 21:45

    Make sure that you have given the Android Wear app on your device access to notifications.

    In 4.4: Settings > Security > Notification Access
    In L Preview: Settings > Sound & Notifications > Notification Access

    Within the Notification access screen, make sure that Android Wear is checked.

    0 讨论(0)
提交回复
热议问题