gpt4 book ai didi

android - 如何从可穿戴通知中删除操作

转载 作者:行者123 更新时间:2023-11-30 00:45:18 25 4
gpt4 key购买 nike

我有一个包含几个操作的通知。我想在穿着时展示它,但没有任何 Action 。如何做到这一点?

builder.extend(new NotificationCompat.WearableExtender().addAction(null)); // Crashes
builder.extend(new NotificationCompat.WearableExtender().clearActions()); // Shows actions on Wear

最佳答案

一直在寻找任何功能来删除可穿戴设备中的操作,但找到了 SO post 1SO post 2这基本上表明无法删除操作。然而,它在 Specify Wearable-only Actions 中提到那个

If you want the actions available on the wearable to be different from those on the handheld, then use WearableExtender.addAction(). Once you add an action with this method, the wearable does not display any other actions added with NotificationCompat.Builder.addAction(). That is, only the actions added with WearableExtender.addAction() appear on the wearable and they do not appear on the handheld.

这样,您可以选择尝试设置一个仅在可穿戴设备中出现的操作。

希望对您有所帮助!

关于android - 如何从可穿戴通知中删除操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41894479/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com