无法创建"单动控制"通知机器人磨损 [英] Can't create "Single-action control" notification android wear

查看:164
本文介绍了无法创建"单动控制"通知机器人磨损的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Wear UI方式显示,使这个通知对Android Wear的能力,但是我无法找到如何完成。我以为只是有一个未决 意图的行动。

IE浏览器: .extend(新NotificationCompat.WearableExtender()的addAction(动作));

会做到这一点,但我没能获得这一观点。任何一个知道是否有特殊的标志,我需要为此设置?谢谢!

解决方案

<一个href="http://developer.android.com/reference/android/app/Notification.WearableExtender.html#setContentAction%28int%29">WearableExtender.setContentAction声明:

  

设置从该通知的动作的动作可以点击本通知的内容。这一行动将不再从通知的内容单独显示。

使用的旁边<一href="http://developer.android.com/reference/android/app/Notification.WearableExtender.html#setContentIcon%28int%29">WearableExtender.setContentIcon直接添加操作到通知的第一页。

请注意:您仍然需要添加的行动,你的code中规定的,然后使用该动作作为输入 setContentAction

The Android Wear UI patterns show the ability to make this notification on Android Wear, however I am not able to find how this is accomplished. I assumed just having one pending intent action.

I.E.: .extend(new NotificationCompat.WearableExtender().addAction(action));

Would achieve this, however I am not able to get this view. Any one know if there is a special flag I need to set for this? Thanks!

解决方案

WearableExtender.setContentAction states:

Set an action from this notification's actions to be clickable with the content of this notification. This action will no longer display separately from the notification's content.

Use that alongside WearableExtender.setContentIcon to add the action directly to the first page of the notification.

Note: you'll still need to add the action as your code stated, then use the index of that action as the input to setContentAction

这篇关于无法创建&QUOT;单动控制&QUOT;通知机器人磨损的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆