---
title: "Disable PDF annotation editing on Android | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/annotations/configuring-annotation-editing/"
md_url: "https://www.nutrient.io/guides/android/annotations/configuring-annotation-editing.md"
last_updated: "2026-06-08T17:11:05.421Z"
description: "Annotation editing can be configured using PdfActivityConfiguration.Builder when using PdfActivity, or using PdfConfiguration.Builder when using PdfFragment."
---

# Disabling annotation editing on Android

Annotation editing can be configured using [`PdfActivityConfiguration.Builder`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration.activity/-pdf-activity-configuration/-builder/index.html) when using [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html), or using [`PdfConfiguration.Builder`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/index.html) when using [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html).

## Controlling which annotation types can be edited

By default, Nutrient enables editing of all supported annotation types. You can disable editing for all annotation types via [`#annotationEditingEnabled(false)`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration.activity/-pdf-activity-configuration/-builder/annotation-editing-enabled.html).

If you want to control which annotation types are editable, use [`#editableAnnotationTypes`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration.activity/-pdf-activity-configuration/-builder/editable-annotation-types.html). For example, when using [`PdfActivityConfiguration.Builder`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration.activity/-pdf-activity-configuration/-builder/index.html):

### KOTLIN

```kotlin

val config =
    PdfActivityConfiguration.Builder(context)
        // By default, all supported annotation types are editable.
        // You can selectively enable certain types by providing them here..editableAnnotationTypes(listOf(AnnotationType.NOTE, AnnotationType.INK, AnnotationType.STAMP)).build()

```

### JAVA

```java

final PdfActivityConfiguration config =
    new PdfActivityConfiguration.Builder(context)
        // By default, all supported annotation types are editable.
        // You can selectively enable certain types by providing them here..editableAnnotationTypes(Arrays.asList(AnnotationType.NOTE, AnnotationType.INK, AnnotationType.STAMP)).build();

```

Or when using [`PdfConfiguration.Builder`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/index.html):

### KOTLIN

```kotlin

val config =
    PdfConfiguration.Builder()
        // By default, all supported annotation types are editable.
        // You can selectively enable certain types by providing them here..editableAnnotationTypes(listOf(AnnotationType.NOTE, AnnotationType.INK, AnnotationType.STAMP)).build()

```

### JAVA

```java

PdfConfiguration config =
    new PdfConfiguration.Builder()
        // By default, all supported annotation types are editable.
        // You can selectively enable certain types by providing them here..editableAnnotationTypes(Arrays.asList(AnnotationType.NOTE, AnnotationType.INK, AnnotationType.STAMP)).build();

```

Passing `null` or an empty list to this method means that all supported annotation types are editable.

The annotation toolbar will only display items that are in [`editableAnnotationTypes`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.configuration/-pdf-configuration/-builder/editable-annotation-types.html), but it also has [its own configuration](https://www.nutrient.io/guides/android/annotations/configuring-annotation-editing.md).

## Enabling modifications only for specific annotation types

You can control which annotation types are editable, and you can specify their types in `editableAnnotationTypes`. For example, you can enable only the modification of ink annotations:

### KOTLIN

```kotlin

val builder = PdfActivityConfiguration.Builder(context)
// Only ink annotations are editable.
builder.editableAnnotationTypes(listOf(AnnotationType.INK))

```

### JAVA

```java

PdfActivityConfiguration.Builder builder = new PdfActivityConfiguration.Builder(context);
// Only ink annotations are editable.
builder.editableAnnotationTypes(Collections.singletonList(AnnotationType.INK));

```

## Disabling adding new annotations but enabling modification of existing ones

Hiding your [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html)’s annotation editing button from the toolbar will prevent users from adding new annotations, but it won’t stop them from editing or deleting existing ones:

### KOTLIN

```kotlin

override fun onPrepareOptionsMenu(menu: Menu): Boolean {
    // It's important to call `super` before removing the item so that Nutrient can add its own items.
    super.onPrepareOptionsMenu(menu)
    // Remove the annotation item.
    menu.removeItem(R.id.pspdf__menu_option_edit_annotations)
    return true
}

```

### JAVA

```java

@Override
public boolean onPrepareOptionsMenu(@NonNull Menu menu) {
    // It's important to call `super` before removing the item so that Nutrient can add its own items.
    super.onPrepareOptionsMenu(menu);
    // Remove the annotation item.
    menu.removeItem(R.id.pspdf__menu_option_edit_annotations);
    return true;
}

```

## Disabling the modification of a specific annotation

You can disable the modification of a specific annotation by using [`setFlags`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.annotations/-annotation/set-flags.html) with the `READONLY` flag, like so:

### KOTLIN

```kotlin

// Make the annotation read-only.
annotation.setFlags(EnumSet.of(AnnotationFlags.READONLY));

```

### JAVA

```java

// Make the annotation read-only.
annotation.setFlags(EnumSet.of(AnnotationFlags.READONLY));

```

For more information, refer to the guide on [annotation flags](https://www.nutrient.io/guides/ios/annotations/annotation-flags.md).
---

## Related pages

- [Embed or attach a file to a PDF on Android](/guides/android/annotations/file-annotations.md)
- [Programmatically create annotations on Android](/guides/android/annotations/programmatically-creating-annotations.md)
- [Define annotation behavior with flags on Android](/guides/android/annotations/annotation-flags.md)
- [Set annotation author names on Android easily](/guides/android/annotations/annotation-author-name.md)
- [Undo and redo annotations on Android](/guides/android/features/undo-redo.md)
- [Copy and paste annotations on Android](/guides/android/features/copy-paste.md)
- [Detect if an annotation has changed on Android](/guides/android/annotations/create-edit-and-remove/detect-changes.md)
- [Z-Index for annotation stacking order on Android](/guides/android/annotations/annotation-z-index.md)

