如何在通知到达时显示带有项目的菜单或对话框
how to present a menu or a dialog with items on arrival of a notification
我们知道我们可以通过添加图标、更改字体、调亮 LED 或添加一些样式来自定义状态栏上的通知。但是在 android 中是否可以在通知到达后显示包含某些项目的菜单?
来自 documentation:
An action allows users to go directly from the notification to an
Activity in your application, where they can look at one or more
events or do further work.
A notification can provide multiple actions. You should always define
the action that's triggered when the user clicks the notification;
usually this action opens an Activity in your application. You can
also add buttons to the notification that perform additional actions
such as snoozing an alarm or responding immediately to a text message;
this feature is available as of Android 4.1. If you use additional
action buttons, you must also make their functionality available in an
Activity in your app
这就是通知执行其他操作的方式。如果你要"present a menu or a dialog with items on arrival of a notification" - 那是完全错误的行为。
我们知道我们可以通过添加图标、更改字体、调亮 LED 或添加一些样式来自定义状态栏上的通知。但是在 android 中是否可以在通知到达后显示包含某些项目的菜单?
来自 documentation:
An action allows users to go directly from the notification to an Activity in your application, where they can look at one or more events or do further work.
A notification can provide multiple actions. You should always define the action that's triggered when the user clicks the notification; usually this action opens an Activity in your application. You can also add buttons to the notification that perform additional actions such as snoozing an alarm or responding immediately to a text message; this feature is available as of Android 4.1. If you use additional action buttons, you must also make their functionality available in an Activity in your app
这就是通知执行其他操作的方式。如果你要"present a menu or a dialog with items on arrival of a notification" - 那是完全错误的行为。