- May 29, 2011
- 1,747
- 297
Miui Launcher has these red notification circles at the icons which shows a number.
Apps like Updater or Messaging use this to inform u about the amount of notification they have for u.
I reverse engineered the code and found out that u can implement this in your App very easily:
"android.intent.extra.update_application_component_name" gets the LauncherActivity in the format "package/.activity"
"android.intent.extra.update_application_message_text" contains the text which will be displayed inside the red circle. Yes it's a string not a number u can write to it whatever you want but it's size is limited(to 3 as far as I know, he will automatically cut it).
You can use this code even if your app isn't for MIUI only because Broadcasts do not raise exceptions. If there is noone to receive them it doesn't matter.
Thx to Medina for the idea
Apps like Updater or Messaging use this to inform u about the amount of notification they have for u.
I reverse engineered the code and found out that u can implement this in your App very easily:
Code:
Intent i = new Intent("android.intent.action.APPLICATION_MESSAGE_UPDATE");
i.putExtra("android.intent.extra.update_application_component_name", "com.launchertest/.MainActivity");
i.putExtra("android.intent.extra.update_application_message_text", "5");
this.sendBroadcast(i);
"android.intent.extra.update_application_component_name" gets the LauncherActivity in the format "package/.activity"
"android.intent.extra.update_application_message_text" contains the text which will be displayed inside the red circle. Yes it's a string not a number u can write to it whatever you want but it's size is limited(to 3 as far as I know, he will automatically cut it).
You can use this code even if your app isn't for MIUI only because Broadcasts do not raise exceptions. If there is noone to receive them it doesn't matter.
Thx to Medina for the idea