> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/ui-customization/quick-menu.md).

# Customize quick menu in Android

Enhance user experience with QuickMenu, a convenient annotation popup menu for PDFViewCtrl. Learn how to customize, hide items, and disable the quick menu easily. Click to explore more! The Apryse And

[`QuickMenu`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/QuickMenu.html) is a convenient annotation popup menu that appears when a user long-presses on a blank space or on text contained in a [`PDFViewCtrl`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/PDFViewCtrl.html). It extends [`RelativeLayout`](https://developer.android.com/reference/android/widget/RelativeLayout.html) and is a child view of [`PDFViewCtrl`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/PDFViewCtrl.html).

| Action                    | Menu                                                                                                                                                                                                                                             |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Long-press on blank space | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-226b11d34f3684f7897f30f17973a9fcaecfe969%2F99319c18720ce3ad7b277deb8dd3a4c1a5129c69-1216x1428.png?alt=media) |
| Long-press on text        | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-b41527d713254edb7f2f4a2c0751f8eebcb2b811%2F75370b9fa2611d10ece730754adc6da0f8400ffb-1239x696.png?alt=media)  |

{% hint style="info" %}
**To learn more about each icon, see the icon cheat sheet .**
{% endhint %}

{% hint style="info" %}
**To learn how to customize the quick menu, see the customize quick menu guide .**
{% endhint %}

## Quick menu events

A number of events may be raised when a user interacts with the quick menu. For example, events will be raised when the quick menu is shown, dismissed, or when a quick menu item is clicked. You can register a [`QuickMenuListener`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.QuickMenuListener.html) to listen to such events and implement custom behavior accordingly.

If your activity is using [`PdfViewCtrlTabHostFragment2`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/controls/PdfViewCtrlTabHostFragment2.html) for viewing PDF files, you can set your listener by calling:

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
mPdfViewCtrlTabHostFragment.getCurrentPDFViewCtrlFragment()
    .addQuickMenuListener(new ToolManager.QuickMenuListener() {
        @Override
        public boolean onQuickMenuClicked(QuickMenuItem menuItem) {
            int which = menuItem.getItemId();
            // Handle click event...
            // Return true to stop executing internal logic
            return true;
        }

        @Override
        public void onQuickMenuShown() {
            // Called when the quick menu is shown
        }

        @Override
        public void onQuickMenuDismissed() {
            // Called when the quick menu is dismissed
        }
    });
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
mPdfViewCtrlTabHostFragment!!.getCurrentPDFViewCtrlFragment()
  .addQuickMenuListener(object : ToolManager.QuickMenuListener {
      override fun onQuickMenuClicked(menuItem: QuickMenuItem): Boolean {
            val which = menuItem.itemId
            // Handle click event...
            // Return true to stop executing internal logic
            return true
      }

      override fun onQuickMenuShown() {
            // Called when the quick menu is shown
      }

      override fun onQuickMenuDismissed() {
            // Called when the quick menu is dismissed
      }
  })
```

{% endcode %}
{% endtab %}
{% endtabs %}

Or you can register the listener using the [`ToolManager`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.html) by calling [`ToolManager.setQuickMenuListener`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.html#setQuickMenuListener\(com.pdftron.pdf.tools.ToolManager.QuickMenuListener\)):

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
mToolManager.setQuickMenuListener(new ToolManager.QuickMenuListener() {
    @Override
    public boolean onQuickMenuClicked(QuickMenuItem menuItem) {
        int which = menuItem.getItemId();
        // Handle click event...
        // Return true to stop executing internal logic
        return true;
    }
    
    @Override
    public void onQuickMenuShown() {
          // Called when the quick menu is shown
    }
    
    @Override
    public void onQuickMenuDismissed() {
          // Called when the quick menu is dismissed
    }
});
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
mToolManager!!.setQuickMenuListener(object : ToolManager.QuickMenuListener {
    override fun onQuickMenuClicked(menuItem: QuickMenuItem): Boolean {
        val which = menuItem.itemId
        // Handle click event...
        // Return true to stop executing internal logic
        return true
    }

    override fun onQuickMenuShown() {
        // Called when the quick menu is shown
    }

    override fun onQuickMenuDismissed() {
        // Called when the quick menu is dismissed
    }
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Hide quick menu items

If there are tools that you would like to remove from the quick menu, you can hide them by calling [`ToolManager.disableToolMode`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.html):

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
// Disable TextSquigglyCreate tool, TextStrikeoutCreate tool
mToolManager.disableToolMode(new ToolMode[]{
    ToolManager.ToolMode.TEXT_SQUIGGLY,
    ToolManager.ToolMode.TEXT_STRIKEOUT}
);
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
mToolManager!!.disableToolMode(arrayOf(ToolManager.ToolMode.TEXT_SQUIGGLY, ToolManager.ToolMode.TEXT_STRIKEOUT))
```

{% endcode %}
{% endtab %}
{% endtabs %}

Then, when you long-press on text you will see:

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-b5603760796659ff6139c059801f1623f11b733c%2F5368b107195e4b2ea540c88e2b669c07e316548e-624x560.png?alt=media)

### ToolMode icon mapping table

| Icon                                                                                                                                                                                                                                         | ToolMode                |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-1c1d424e10816c07c7d16af63466592d9b1ce628%2F9a81d8b6f7a1d3372ad64c240e5f0679d4bb347b-24x24.svg?alt=media) | `RECT_CREATE`           |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-e4e33c56f007bc51eea6f744a88ad3488af0eb20%2F120cca1bbbafe69fc2e401936ac768add70b22e6-24x24.svg?alt=media) | `OVAL_CREATE`           |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-3d23e958c364b9c9f7f1eabd551344c5eebde365%2Fb12c8a3e27c54bca226b872f8a905d50d86fb798-24x24.svg?alt=media) | `POLYLINE_CREATE`       |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-3a3ce70ad76520c3f421a1823fab081cc658767f%2Fdc5595673a06087adf0089101060106dd99e9290-24x24.svg?alt=media) | `POLYGON_CREATE`        |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-334579f3c43fe4c545387e019893011b3543e6ae%2Feffac6045aca57928ccb5d3aa2cbc87c61316c9c-24x24.svg?alt=media) | `CLOUD_CREATE`          |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-c20d84c853c60f5dc3db82d2f9ee9b51b4f1e99e%2F51edc969eb91d7192e88e5198d636e479e6dcd14-24x24.svg?alt=media) | `LINE_CREATE`           |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-b4d6f026887a84ea30eff8a00943d189f15bc755%2F033443eedda0e4c596e40786020ca58eb81b8626-24x24.svg?alt=media) | `ARROW_CREATE`          |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-202c4fe4f6690a01f41b1aca77c1ddfc7279e49f%2F0a8369e09eda863761e52861bb52721639cfc1bb-24x24.svg?alt=media) | `RULER_CREATE`          |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-c48ff2b5f71708c110cf9a6799efeecefce4354a%2Fb409a23d049a72d5e0776e6ab7a10fe8f4492b32-24x24.svg?alt=media) | `TEXT_CREATE`           |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-b44c232f2e5c4246620c7b9f512213841d096dbf%2F3d18c76eaf50b917c44c5c8e2d4b2c68f8292001-24x24.svg?alt=media) | `CALLOUT_CREATE`        |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-205aecff8c218d172d65434d865a725d5cdd6eb3%2Fcb2e68870a99880261708f138ab6f14128a55201-24x24.svg?alt=media) | `TEXT_ANNOT_CREATE`     |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-f58c360e5a9355c2d9dd95423ba99bd1d04a6ea8%2F356d8532995c5a5a99eecfa9c001c3286f04ea3e-24x24.svg?alt=media) | `INK_CREATE`            |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-e37e4d0227b7c88f5f9c9c24d5926d8a32c7254a%2Fa2b066cf9b51ce6b8122da4d2ef2926a37e69730-24x24.svg?alt=media) | `INK_ERASER`            |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-04441d8f60bc2d65f41ce1e640b78d6752237d8e%2F644d3fc352883a49adeb23b4de481c31cd0bdbb6-24x24.svg?alt=media) | `SIGNATURE`             |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-33bc19967a7d3c3bee985d081ef913ce6b9a1f26%2Fb3e2b5da8d91ac87b9f87c5c22178ac37604baee-24x24.svg?alt=media) | `STAMPER`               |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-c61c9dfe355ba997f44e9fdc0ee44b9999f0205f%2F5917d9a05bc01aff851a3d7a3e5f1c04a7ddefbe-24x24.svg?alt=media) | `RUBBER_STAMPER`        |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-dc6a65856fd54c58669ad9d9b3b966b32fae361b%2Ff38eb9045d6707537a9d2925c468ff7c938ac620-24x24.svg?alt=media) | `FREE_HIGHLIGHTER`      |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-f462694c891b12cef763bcb6d49db217b6b321a3%2F71c5db15fe224b8325ee73b398cd6bd6165e9a60-24x24.svg?alt=media) | `TEXT_HIGHLIGHT`        |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-d968a765a85a035edf5d4f705dc22588b118c3eb%2Fd1ccdcff4e8b99619fcaa5ef9167f7835010f44d-24x24.svg?alt=media) | `TEXT_UNDERLINE`        |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-b793112c3bc5fe4eef238675817cc2b0a8658cec%2Fc73e8eeb4b36e518c805324b38e19dea48d5eeb7-24x24.svg?alt=media) | `TEXT_SQUIGGLY`         |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-103cd0f0eaea65fbea74ff0188fc6ef9ab1dab62%2F258f7041e187cdf49d5297b5fd77deaae5368f7f-24x24.svg?alt=media) | `TEXT_STRIKEOUT`        |
| ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-dd781105b73c1ee31b8ca0f046b906babd519f5f%2F2109952732e26c463f729626218d25d4cf29dca0-24x24.svg?alt=media) | `ANNOT_EDIT_RECT_GROUP` |

## Disable quick menu

If you would like to hide the long press quick menu entirely, you can do so by calling [`ToolManager.setDisableQuickMenu`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.html#setDisableQuickMenu\(boolean\)). For example:

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
mToolManager.setDisableQuickMenu(true);
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
mToolManager!!.setDisableQuickMenu(true)
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/ui-customization/quick-menu.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
