[android-components](../index.md) / [mozilla.components.browser.menu.item](index.md) / [setBadgeText](./set-badge-text.md)

# setBadgeText

`fun <ERROR CLASS>.setBadgeText(badgeText: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/browser/menu/src/main/java/mozilla/components/browser/menu/item/WebExtensionBrowserMenuItem.kt#L124)

Sets the badgeText and the visibility of the TextView based on empty/nullability of the badgeText.

