4

I would like to make an icon counter for andoid just like the Email and the Samsung Apps applications i have seen such requests from other developers, but you all say it can't be done.

enter image description here

if so how come those 2 apps and other apps can do it?

do i have to make like more than one icon image and swap them or something?

is it really cant be done and why?

thanks.

Waqleh
  • 9,741
  • 8
  • 65
  • 103
  • I would use widgets for that, even when the widget has to be manually placed to the home screen by the user – mdelolmo Nov 07 '12 at 14:17
  • Because the icon is an asset bundled in your APK and there is no mechanism for an app to change the icon at runtime. Only the launcher can do that. Widget is only choice - sadly. – Simon Nov 07 '12 at 14:21
  • it would be a cool feature. how come the email app can do so, even when you create folders the folders show the inner notifications of all apps count – Waqleh Nov 07 '12 at 14:24
  • The way how Samsung does it, well, I believe that's the feature of their launcher and not Email application. Replace TouchWiz launcher with a third party launcher and you will not get counter badge on top of the icon. – uaraven Nov 07 '12 at 14:30
  • im sad to know that. i give up – Waqleh Nov 07 '12 at 14:48
  • Possible duplicate of [Is there a way to add a badge to an application icon in Android?](https://stackoverflow.com/questions/2905542/is-there-a-way-to-add-a-badge-to-an-application-icon-in-android) – Waqleh May 22 '18 at 11:02

1 Answers1

4

you all say it can't be done.

That is because it cannot be done, except by the maker of the home screen, or via an app widget (instead of a launcher icon).

if so how come those 2 apps and other apps can do it?

Because Samsung wrote the home screen and can do what it wants with its home screen.

do i have to make like more than one icon image and swap them or something?

That will not work, as you cannot change the launcher icon at runtime.

is it really cant be done and why?

It really can be done by making an app widget, or by making your own home screen.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491