Skip to content
Advertisement

Tag: material-design

How to add a badge above a button?

In my MainActivity class, I have this button: I now want to add a badge with the number 1, using Material Design (see the documentation). This is how I tried: but what I get is the error ‘attachBadgeDrawable(com.google.android.material.badge.BadgeDrawable, android.view.View, android.widget.FrameLayout)’ in ‘com.google.android.material.badge.BadgeUtils’ cannot be applied to ‘(com.google.android.material.badge.BadgeDrawable, android.view.View)’ Answer If you tried this on a device with <18 API this

Advertisement