How to add Android notification counter

How to add a notification counter in an Android app, just like for Facebook? I tried searching, but I did not find anything that could help. I don’t want the oncoming launcher badge to have an oncoming ball. Instead, I want it to be inside my application on the icon of the icon and the icon of friends.

My search includes:

In all other examples, including them, the inscription on the launcher is displayed. I do not want a balloon notification above the launch icon. Instead, I want the notification balloon to be in my app with a notification icon similar to the Facebook icon. How can i implement this? Any suggestions, steps or guides will be appreciated.

enter image description here

+4
source share
1 answer

This can be achieved using this library. https://github.com/jgilfelt/android-viewbadger

Include the library in your project and add the code below to view it.

View target = findViewById(R.id.target_view);
BadgeView badge = new BadgeView(this, target);
badge.setText("1");
badge.show();
+5
source

Source: https://habr.com/ru/post/1540962/


All Articles