title: How to add a badge above a button?
body: <p>In my MainActivity class, I have this button:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Button
      android:id=&quot;@+id/target&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_below=&quot;@id/speak&quot;
      android:layout_marginTop=&quot;20dp&quot;
      android:background=&quot;@drawable/button_red&quot;
      android:text=&quot;@string/target&quot; /&gt;
  </code></pre>
  <p>I now want to add a badge with the number 1, using Material Design (see the <a href="https://material.io/develop/android/components/badging" rel="nofollow noreferrer">documentation</a>).</p>
  <p>This is how I tried:</p>
  <pre class="lang-java prettyprint-override"><code>public void setBadge() {
      BadgeDrawable badgeDrawable =  BadgeDrawable.create(MainActivity.this);
      badgeDrawable.setNumber(1);
      BadgeUtils.attachBadgeDrawable(badgeDrawable, findViewById(R.id.target));
  }
  </code></pre>
  <p>but what I get is the error</p>
  <blockquote>
  <p>'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)'</p>
  </blockquote>