AppDevs: Use MiLaunchers NotificationCircles


M1cha

Members
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:
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 :)
 
Awesome discovery. Will put it to good use.

Gesendet von meinem MI 2 mit Tapatalk 4 Beta
 
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°
 
Best way to get this into apps like Facebook is via xposed framework or wsm.

Sent from my GT-I9505 using Tapatalk
 
  • Like
Reactions: xeGox
Hoping to be useful for @BurgerZ

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