【问题标题】:Only the notification from my mobile app doesnt appear in watch Android wear只有来自我的移动应用程序的通知不会出现在手表 Android 磨损中
【发布时间】:2016-08-08 02:11:11
【问题描述】:

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

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());

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

【问题讨论】:

    标签: android wear-os android-wear-notification


    【解决方案1】:

    Create Notifications with the Notification Builder 中所述,当此通知出现在手持设备上时,

    用户可以通过触摸通知调用setContentIntent()方法指定的PendingIntent。当此通知出现在 Android 可穿戴设备上时,用户可以向左滑动通知以显示 Open 操作,该操作会在手持设备上调用 Intent。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多