向通知背景添加操作
Add action to background of a Notification
在 Android Lollipop 上,应用程序在长按时有一个 "background" 选项。
通常情况下,您可以选择点击 "Info" 图标并进入 Android 设置应用程序,您可以在其中禁用通知、将其设置为重要或明智。
现在,WhatsApp 或 Inbox 等应用程序可以通过另一个选项("cogwheel" 图标)进入应用程序自己的通知首选项。我怎样才能在通知的背景下完成这个额外的动作?
通过阅读文档终于弄清楚了它是如何工作的。
显然,您必须向清单中的 activity 添加一个意图过滤器:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
</intent-filter>
在 Android Lollipop 上,应用程序在长按时有一个 "background" 选项。
通常情况下,您可以选择点击 "Info" 图标并进入 Android 设置应用程序,您可以在其中禁用通知、将其设置为重要或明智。
现在,WhatsApp 或 Inbox 等应用程序可以通过另一个选项("cogwheel" 图标)进入应用程序自己的通知首选项。我怎样才能在通知的背景下完成这个额外的动作?
通过阅读文档终于弄清楚了它是如何工作的。
显然,您必须向清单中的 activity 添加一个意图过滤器:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
</intent-filter>