| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright 2013 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <sample> |
| <name>ActiveNotifications</name> |
| <group>Notification</group> |
| <package>com.example.android.activenotifications</package> |
| |
| <minSdk>24</minSdk> |
| <compileSdkVersion>24</compileSdkVersion> |
| <targetSdkVersion>24</targetSdkVersion> |
| |
| <strings> |
| <intro> |
| <![CDATA[ |
| Notifications can now be grouped in Android N. Since Android M, the |
| NotificationManager can tell you how many notifications your application |
| is currently showing. This sample demonstrates how to use these APIs |
| together for a nicer user experience when an app may have multiple |
| notifications. To get started, press the "add a notification" button. |
| If you add more than one notification a notification summary will be |
| added. When a notification is being canceled, the count gets updated |
| via a PendingIntent. |
| ]]> |
| </intro> |
| </strings> |
| |
| <template src="base" /> |
| <template src="FragmentView" /> |
| <common src="activities" /> |
| <common src="logger" /> |
| |
| <metadata> |
| <status>PUBLISHED</status> |
| <categories>Notification</categories> |
| <technologies>Android</technologies> |
| <languages>Java</languages> |
| <solutions>Mobile</solutions> |
| <level>INTERMEDIATE</level> |
| <icon>screenshots/icon-web.png</icon> |
| <screenshots> |
| <img>screenshots/screenshot01.png</img> |
| <img>screenshots/screenshot02.png</img> |
| <img>screenshots/screenshot03.png</img> |
| </screenshots> |
| <api_refs> |
| <android>android.app.NotificationManager</android> |
| </api_refs> |
| <description> |
| <![CDATA[ |
| Notification Groups and the Notification Manager can be used together to simplify |
| how users experience notifications. This sample demonstrates how |
| the NotificationManager can tell you how many notifications your |
| application is currently showing. It also shows how to manage the |
| notifications as a group and introduce a summary for the group, when |
| supported by the platform. |
| ]]> |
| </description> |
| <intro> |
| <![CDATA[ |
| Notifications can now be grouped. |
| |
| Starting with Android N, you can set notification groups for notifications |
| and define a notification group summary. |
| |
| In Android M, you can query for the active notifications that your app sent |
| sing the [notify][2] methods. |
| |
| This sample demonstrates simple use of these features by allowing a user |
| to add notifications and then query how many notifications |
| are currently being displayed via the [getActiveNotifications()][3] method. |
| |
| [1]: https://developer.android.com/reference/android/app/NotificationManager.html |
| [2]: https://developer.android.com/reference/android/app/NotificationManager.html#notify(int, android.app.Notification) |
| [3]: https://developer.android.com/reference/android/app/NotificationManager.html#getActiveNotifications() |
| ]]> |
| </intro> |
| </metadata> |
| </sample> |