How to add Notification Counter in Android

Recently I had a chance to develop a social networking application, I had to create a notification bubble over friends and messages, So I managed to do it like this.

OZ4qe

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s