AppDevs: Use MiLaunchers NotificationCircles


M1cha

Members
May 29, 2011
1,747
2,839
297
#1
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:
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 :)
 
Feb 26, 2013
399
58
62
#5
I searched this for a long time...
But... How could we do for famous app like playstore, whatsapp, Facebook, Skype, hangout, etcetc?

Sent from Xiaomi Mi-4g ( the "g" is for graveyard not for great )...with tapatalk 26°