1. This function refers to the number displayed by the app icon, such as an unread text message, an email, an icon similar to an iOS app
Native Android system does not support this feature
Customized Samsung,sony support this feature, with each corresponding to different implementations, take Samsung as an example
1. Add two permissions in Androidmanifest.xml: <uses-permission android:name= "Com.sec.android.provider.badge.permission.READ" /><uses-permission android:name= "Com.sec.android.provider.badge.permission.WRITE"/>2. Check to see if your app is registered in Badgeprovider: URI uri = uri.parse ("Content://com.sec.badge/apps"); Cursor C = getcontentresolver (). Query (URI, NULL, NULL, NULL, NULL), if (c = = null) {return;} try {if (!c.movetofirst ()) {return; } c.movetoposition (-1); while (C.movetonext ()) {String pkg = c.getstring (1); String clazz = c.getstring (2); int badgecount = C.getint (3); LOG.D ("Badgetest", "Package:" + pkg + ", class:" + Clazz + ", Count:" + string.valueof (CNT)); }} finally {C.close ();} 3. Register if not registered: contentvalues CV = new Contentvalues () cv.put ("Package", Getpackagename ());//Name of your activity Declared in the manifest as android.intent.action.main.//must is fully qualified name as shown Belowcv.put ("Class", "com. Example.badge.activity.Test ");Cv.put ("Badgecount", 1); Integer count you want to display//Execute insertgetcontentresolver (). Insert (Uri.parse ("content://com.sec.badge/ Apps "), CV), 4. If you have already registered, use the following method to update the corner label: contentvalues CV = new Contentvalues (), Cv.put (" Badgecount ", 0); Getcontentresolver (). Update (Uri.parse ("Content://com.sec.badge/apps"), CV, "Package=?", new string[] {getpackagename ()}); Attached: Badgeprovider Https://github.com/shafty023/SamsungBadger
Reference http://blog.csdn.net/qq549631030/article/details/38512207
2. Open source controls are available for digital reminder displays that apply view levels
Https://github.com/jgilfelt/android-viewbadger
Android app icon Upper right corner unread message number hint