How to add Notification Counter Android

android, android-notification-bar, android-notifications

Solution

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

Include library in your project and add below code for your view.

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

Problem

How do I add a notification Counter in Android Application, Similar to that of Facebook's? I have tried searching but I have not found anything that can help. I do not want counter baloon on the launcher icon. Instead, I want it inside my application on notification icon and friends icon. My Search Includes: How to display balloon counter over application launcher icon on android How to display count of notifications in app launcher icon How to display balloon counter over application launcher icon? All of the other examples including these are showing notification balloon over the launcher icon. I do not want notification balloon over the launcher icon. Instead, I want the notification balloon inside my application over notification icon similar to Facebook's one. How can I implement it? Any suggestions, steps, or guides would be appreciated.

Original source

Related problems