# AnnotationsView.OnAnnotationEditListener

Artifact: [androidx.pdf:pdf-viewer](https://developer.android.com/jetpack/androidx/releases/pdf) [View Source](https://cs.android.com/search?q=file:androidx/pdf/annotation/AnnotationsView.kt+class:androidx.pdf.annotation.AnnotationsView.OnAnnotationEditListener) Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

*** ** * ** ***


```
public interface AnnotationsView.OnAnnotationEditListener
```

<br />

*** ** * ** ***

Callback interface for events related to the creation and modification of annotations.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/pdf/annotation/AnnotationsView.OnAnnotationEditListener#onAnnotationCreated(androidx.pdf.annotation.content.PdfAnnotation)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/annotation/content/PdfAnnotation annotation)` Called when an in-progress interaction successfully produces a finalized `https://developer.android.com/reference/androidx/pdf/annotation/content/PdfAnnotation`. |
| `abstract void` | `https://developer.android.com/reference/androidx/pdf/annotation/AnnotationsView.OnAnnotationEditListener#onAnnotationError(kotlin.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html throwable)` Called when a failure occurs during the creation or modification of an annotation. |

## Public methods

### onAnnotationCreated

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
abstract void onAnnotationCreated(@NonNull PdfAnnotation annotation)
```

Called when an in-progress interaction successfully produces a finalized `https://developer.android.com/reference/androidx/pdf/annotation/content/PdfAnnotation`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/annotation/content/PdfAnnotation annotation` | The finalized `https://developer.android.com/reference/androidx/pdf/annotation/content/PdfAnnotation` object containing the metadata generated by the user's interaction. |

### onAnnotationError

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
abstract void onAnnotationError(@NonNull Throwable throwable)
```

Called when a failure occurs during the creation or modification of an annotation.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html throwable` | The underlying cause of the failure. |