2016-08-08 57 views
0

我正在使用LG Watch Urban。我已成功将手表与手机连接,手表正在显示来自gmail,linkedin和其他应用程序的所有通知。我写了一个移动应用程序,发送通知。但是这个通知不会出现在手表中,但通知是通过手机发送的。我不知道这是什么原因。我使用下面的代码,只有我的手机应用程序通知不会出现在手表Android Wear

NotificationCompat.Builder notificationBuilder = 
       new NotificationCompat.Builder(this) 
       .setSmallIcon(R.drawable.ic_adb_black_24dp) 
       .setContentTitle("Title") 
       .setContentText("Hello World"); 

     NotificationManagerCompat notificationManager = 
       NotificationManagerCompat.from(this); 

     notificationManager.notify(notificationId,notificationBuilder.build()); 

我验证了伴侣Android穿应用程序,没有我的移动应用程序在被阻止的应用程序列表中。任何帮助将不胜感激。

回答

0

Create Notifications with the Notification Builder提到的,当这个通知将出现在手持设备上,

的用户可以通过触摸该通知调用由setContentIntent()方法指定的PendingIntent。当此通知显示在Android可穿戴设备上时,用户可以将通知滑动到左侧以显示打开操作,该操作会调用手持设备上的意图。

更多的信息和示例代码可以在Creating a Notification for Wearables找到。

除此之外,还请尝试在Android Wear帮助支持中给出的故障排除步骤 - I’m not getting notifications on my watch

相关问题