我曾嘗試下面的意圖方法,但它不能正常工作,如何在我的android應用程序中的啓動器圖標上顯示徽章計數?
Intent intent = new Intent("android.intent.action.BADGE_COUNT_UPDATE");
intent.putExtra("badge_count", 3);
intent.putExtra("badge_count_package_name", getApplicationContext().getPackageName());
intent.putExtra("badge_count_class_name", MainActivity.class.getName());
getApplicationContext().sendBroadcast(intent);
使用這個很酷的[庫](https://github.com/leolin310148/ShortcutBadger) –