在Android 5.0上,通过Settings -> Sound & notification -> App notification -> Calendar (for example)
有一个选项可直接转到应用程序的通知设置。
我也知道它是清单中的一个标志,如DEV.BYTES talk中所述。
如何实现,使用的是什么标志?如何将通知设置活动添加到系统设置
下面是更多的澄清截图:
在Android 5.0上,通过Settings -> Sound & notification -> App notification -> Calendar (for example)
有一个选项可直接转到应用程序的通知设置。
我也知道它是清单中的一个标志,如DEV.BYTES talk中所述。
如何实现,使用的是什么标志?如何将通知设置活动添加到系统设置
下面是更多的澄清截图:
你需要通过你的AndroidManifest
到Intent
类别Notification.INTENT_CATEGORY_NOTIFICATION_PREFERENCES
添加到Activity
你想推出。一个简单的例子是这样的:
<activity android:name="com.example.packagename.YourSettingsActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
</intent-filter>
</activity>
有关详细信息,请参阅设置应用和具体的NotificationAppList
和AppNotificationSettings
片段。
结果
我本来期望看到的东西[应用程序的清单(https://android.googlesource.com/platform/packages/apps/Calendar/+/master /AndroidManifest.xml),但似乎没有可能。 – CommonsWare 2015-02-24 12:17:26
@CommonsWare利用通知首选项的Google日历应用程序是Google在Play商店中的专有应用程序。 – adneal 2015-02-25 02:45:39