> 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/annotation/disable-annot-create-edit.md).

# Disable annotations in Android toolbar

Discover how to customize annotation creation tools in your app with the long-press QuickMenu and AnnotationToolbar. Learn how to enable/disable editing and other actions for a seamless user experienc

The long-press [QuickMenu](/android/ui-customization/quick-menu.md) and [AnnotationToolbar](/android/annotation/annotation-toolbar-a.md) show a default set of annotation creation tools. Editing of existing annotations is enabled for all annotation types by default. Other actions that are not tied to annotation creation or editing, such as text selection, form filling, link following, and multimedia playing are enabled by default.

## Disable annotation creation

To hide annotation creation tool(s) from the quick menu and annotation toolbar, you can set it in a centralized place with either[`ToolManagerBuilder`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/config/ToolManagerBuilder.html) or [`ToolManager`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/ToolManager.html) depending on the fit.

See annotation and tool mode mapping here: annotation and its creation tool.

The following example hides text highlight and arrow annotation creation tool from the quick menu and annotation toolbar:

To use in `ToolManagerBuilder`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
ToolManagerBuilder.From().DisableToolMode(new ToolManager.ToolMode[] {
    ToolManager.ToolMode.ArrowCreate,
    ToolManager.ToolMode.TextHighlight
});
```

{% endcode %}
{% endtab %}

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

```java
ToolManagerBuilder.from().disableToolMode(new ToolMode[]{
    ToolManager.ToolMode.ARROW_CREATE,
    ToolManager.ToolMode.TEXT_HIGHLIGHT}
)
```

{% endcode %}
{% endtab %}

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

```kotlin
ToolManagerBuilder.from().disableToolMode(arrayOf(
    ToolManager.ToolMode.ARROW_CREATE,
    ToolManager.ToolMode.TEXT_HIGHLIGHT
))
```

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

To use in `ToolManager`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
mToolManager.DisableToolMode(new ToolManager.ToolMode[] {
    ToolManager.ToolMode.ArrowCreate,
    ToolManager.ToolMode.TextHighlight
});
```

{% endcode %}
{% endtab %}

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

```java
mToolManager.disableToolMode(new ToolMode[]{
    ToolManager.ToolMode.ARROW_CREATE,
    ToolManager.ToolMode.TEXT_HIGHLIGHT}
);
```

{% endcode %}
{% endtab %}

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

```kotlin
mToolManager.disableToolMode(arrayOf(
    ToolManager.ToolMode.ARROW_CREATE,
    ToolManager.ToolMode.TEXT_HIGHLIGHT
))
```

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

## Disable annotation editing

To disable annotation editing for certain annotation type(s), you can set it in a centralized place with either `ToolManagerBuilder` or `ToolManager` depending on the fit.

The following example disables editing of ellipse and rectangle annotations:

To use in `ToolManagerBuilder`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
ToolManagerBuilder.From().DisableAnnotEditing(new Java.Lang.Integer[]
{
    new Java.Lang.Integer((int)Annot.Type.e_Circle),
    new Java.Lang.Integer((int)Annot.Type.e_Square)
});
```

{% endcode %}
{% endtab %}

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

```java
ToolManagerBuilder.from().disableAnnotEditing(new Integer[]{
    Annot.e_Circle,
    Annot.e_Square}
);
```

{% endcode %}
{% endtab %}

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

```kotlin
ToolManagerBuilder.from().disableAnnotEditing(arrayOf(Annot.e_Circle, Annot.e_Square))
```

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

To use in `ToolManager`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
mToolManager.DisableAnnotEditing(new Java.Lang.Integer[]
{
    new Java.Lang.Integer((int)Annot.Type.e_Circle),
    new Java.Lang.Integer((int)Annot.Type.e_Square)
});
```

{% endcode %}
{% endtab %}

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

```java
mToolManager.disableAnnotEditing(new Integer[]{
    Annot.e_Circle,
    Annot.e_Square}
);
```

{% endcode %}
{% endtab %}

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

```kotlin
mToolManager.disableAnnotEditing(arrayOf(Annot.e_Circle, Annot.e_Square))
```

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

## Disable functionality

Functionality that is not directly tied to annotation creation or editing such as text selection, form filling, link following etc. can also be disabled. Each functionality is in the form of a `Tool`. Once a `Tool` is disabled, `ToolManager` will never switch to it. Instead, it will switch to the `Pan` tool. `Pan` tool cannot be disabled.

The following example disables form filling and link following:

To use in `ToolManagerBuilder`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
ToolManagerBuilder.From().DisableToolMode(new ToolManager.ToolMode[] {
    ToolManager.ToolMode.LinkAction,
    ToolManager.ToolMode.FormFill
});
```

{% endcode %}
{% endtab %}

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

```java
ToolManagerBuilder.from().disableToolMode(new ToolMode[]{
    ToolManager.ToolMode.LINK_ACTION,
    ToolManager.ToolMode.FORM_FILL}
)
```

{% endcode %}
{% endtab %}

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

```kotlin
ToolManagerBuilder.from().disableToolMode(arrayOf(
    ToolManager.ToolMode.LINK_ACTION,
    ToolManager.ToolMode.FORM_FILL
))
```

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

To use in `ToolManager`:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
mToolManager.DisableToolMode(new ToolManager.ToolMode[] {
    ToolManager.ToolMode.LinkAction,
    ToolManager.ToolMode.FormFill
});
```

{% endcode %}
{% endtab %}

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

```java
mToolManager.disableToolMode(new ToolMode[]{
    ToolManager.ToolMode.LINK_ACTION,
    ToolManager.ToolMode.FORM_FILL}
);
```

{% endcode %}
{% endtab %}

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

```kotlin
mToolManager.disableToolMode(arrayOf(
    ToolManager.ToolMode.LINK_ACTION,
    ToolManager.ToolMode.FORM_FILL
))
```

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

See annotation and tool mode mapping here: annotation and its creation tool.


---

# 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/annotation/disable-annot-create-edit.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.
