Arjun sharma Arjun sharma - 1 year ago 1118
Android Question

Android Tablayout tabs with notification badge like whatsApp

I want to implement notification badge with
. I had tried my best effort to implement it but fails.

Any help would by greatly appreciated.

Answer Source

My solution to this was using and setting a custom view to each tab:

My tabs have only icons so I used ImageView, but I believe you can use any other view, check

private BadgeView badge;

Tab tab = tabLayout.getTabAt(position);
ImageView imageView = new ImageView(context);
badge = new BadgeView(context, imageView);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download