Like the image above, text messaging app on AndroidIf you look at Kakao, the number of alarms on iKON is shown in a red circle. I also want to put it up on the icon of my app, what should I do?
android
int badgeCount = 3;
Intent intent = new Intent("android.intent.action.BADGE_COUNT_UPDATE");
intent.putExtra("badge_count", badgeCount);
// Package name of the application that appears in the main menu
intent.putExtra("badge_count_package_name", getComponentName().getPackageName());
// The class name of the application that appears in the main menu
intent.putExtra("badge_count_class_name", getComponentName().getClassName());
sendBroadcast(intent);
If the bad count is 0, there is no indication on the icon, and if it is more than 1, there will be indication on the icon.
© 2024 OneMinuteCode. All rights reserved.