2016-08-08 60 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

相關問題