4

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

Community
  • 1
  • 1
Hassaan Rabbani
  • 2,399
  • 5
  • 27
  • 50
  • There is no native way of adding a notification counter in android applications. or if we put it other way around, none has been discovered yet. so i do not understand why this question has been put on hold? – Hassaan Rabbani May 17 '14 at 17:17

1 Answers1

5

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();
Swapnil Godambe
  • 2,014
  • 1
  • 22
  • 28
  • I am unable to add this library into my android project following these steps File->New->Other Select Android Project Select "Create Project from existing source" Click "Browse..." button and navigate to johannilsson-android-actionbar\actionbar Finish (Now action bar project in your workspace) Right-click on your project -> Properties In Android->Library section click Add select recently added project -> Ok – Hassaan Rabbani May 20 '14 at 17:17