Hassaan Rabbani
Hassaan Rabbani

Reputation: 2465

How to add Notification Counter Android

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:

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.

enter image description here

Upvotes: 4

Views: 3986

Answers (1)

Swapnil Godambe
Swapnil Godambe

Reputation: 2044

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();

Upvotes: 5

Related Questions