---
title: "How to remove a button from toolbars"
canonical_url: "https://www.nutrient.io/guides/android/knowledge-base/remove-tool-variant-from-toolbar/"
md_url: "https://www.nutrient.io/guides/android/knowledge-base/remove-tool-variant-from-toolbar.md"
last_updated: "2026-06-26T03:15:47.233Z"
description: "Learn to remove the ink highlighter button from the annotation creation toolbar in Nutrient. Customize your toolbars for a streamlined user experience."
---

You can edit Nutrient’s toolbars before they’re displayed onscreen. This example shows how to remove the ink highlighter button from the annotation toolbar:

```kt

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setOnContextualToolbarLifecycleListener(this)
}

override fun onPrepareContextualToolbar(toolbar: ContextualToolbar<*>) {
    if (toolbar is AnnotationToolbar) {
        // Get the existing menu items so you can modify them.
        val menuItems = toolbar.menuItems

        // Find and remove the ink highlighter button from the toolbar.
        val highlighterItem = menuItems.find { it.id ==  R.id.pspdf__annotation_toolbar_item_ink_highlighter}
        if (highlighterItem!= null) {
            menuItems.remove(highlighterItem)
        }

        // Replace the menu items.
        toolbar.setMenuItems(menuItems)
    }
}

override fun onDisplayContextualToolbar(toolbar: ContextualToolbar<*>) {}
override fun onRemoveContextualToolbar(toolbar: ContextualToolbar<*>) {}

```

---

## Related pages

- [Allow Clear Text Traffic](/guides/android/knowledge-base/allow-clear-text-traffic.md)
- [Custom Print Functionality](/guides/android/knowledge-base/custom-print-functionality.md)
- [Deleting Pages From A Pdf](/guides/android/knowledge-base/deleting-pages-from-a-pdf.md)
- [Compose Qna](/guides/android/knowledge-base/compose-qna.md)
- [Easily disable share and print options in Android](/guides/android/knowledge-base/disable-share-documentinfo-print.md)
- [Disabling Annotation Rotation](/guides/android/knowledge-base/disabling-annotation-rotation.md)
- [Change page layout dynamically based on orientation](/guides/android/knowledge-base/dynamic-page-layout-when-changing-orientation.md)
- [Managing touch scrolling in Compose containers](/guides/android/knowledge-base/document-view-inside-pager-scroll-handling.md)
- [Getting All Digital Signatures](/guides/android/knowledge-base/getting-all-digital-signatures.md)
- [Intercepting Touch Events](/guides/android/knowledge-base/intercepting-touch-events.md)
- [Getting Signature Location](/guides/android/knowledge-base/getting-signature-location.md)
- [Install Failed Insufficient Storage](/guides/android/knowledge-base/install-failed-insufficient-storage.md)
- [Invoking Share Action Programmatically](/guides/android/knowledge-base/invoking-share-action-programmatically.md)
- [Creating invisible digital signatures in Android](/guides/android/knowledge-base/invisible-signature.md)
- [Invoke Search Programmatically](/guides/android/knowledge-base/invoke-search-programmatically.md)
- [Override Hyperlink Behavior](/guides/android/knowledge-base/override-hyperlink-behavior.md)
- [Making Form Elements Read Only](/guides/android/knowledge-base/making-form-elements-read-only.md)
- [Runtime Permissions Cordova](/guides/android/knowledge-base/runtime-permissions-cordova.md)
- [Customize the overflow button color in Android](/guides/android/knowledge-base/styling-overflow-button.md)
- [Save signed PDFs directly to a remote server on Android](/guides/android/knowledge-base/save-signed-pdfs-to-remote-server.md)
- [Using Pspdfkit With Dynamic Feature Modules](/guides/android/knowledge-base/using-pspdfkit-with-dynamic-feature-modules.md)

