How notification categories are assigned in the Android / API Preview 20

In accordance with the Design for Notifications document, notifications can (and should) include a category when they are created. Categories include things like calls, messages, promotions, progress notifications, system messages, and social updates.

In addition to listing categories, actual system library constants are listed on the page, for example Notification.CATEGORY_CALL, Notification.CATEGORY_PROGRESSand Notification.CATEGORY_SOCIAL.

However, these constants and the entire category system are apparently only mentioned on the Design for Notifications page. At this writing, the API documentation for Notification does not include these constants, and there seems to be no such method as setCategorythat registered in Notification.Builder. A Google search for "Notification.CATEGORY_PROGRESS" includes only the Design for Notifications document.

Does anyone know how to actually use these categories, and assign them to your notifications in L preview?

EDIT:

A look at the current Notification source code in the current aosp / preview-l branch does not show any evidence of constants. Could this be a function that did not shorten for release? (If so, is there anyone there who can confirm this?)

For reference:

" ": https://developer.android.com/preview/notifications.html#set_a_notification_category

Google : https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=%22Notification.CATEGORY_PROGRESS%22

EDIT:

A-C , , ( , ). .

EDIT:

setCategory API 21/Lollipop. , .

+4
1

L Developer Preview Documentation , setCategory() , Builder.

, .

, , l-preview .

Android, , , , , .

+1

Source: https://habr.com/ru/post/1547795/


All Articles