# 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)

*** ** * ** ***


```
interface AnnotationsView.OnAnnotationEditListener
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/AnnotationsView.OnAnnotationEditListener#onAnnotationCreated(androidx.pdf.annotation.content.PdfAnnotation)(annotation: https://developer.android.com/reference/kotlin/androidx/pdf/annotation/content/PdfAnnotation)` Called when an in-progress interaction successfully produces a finalized `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/content/PdfAnnotation`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/annotation/AnnotationsView.OnAnnotationEditListener#onAnnotationError(kotlin.Throwable)(throwable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` Called when a failure occurs during the creation or modification of an annotation. |

## Public functions

### onAnnotationCreated

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

```
fun onAnnotationCreated(annotation: PdfAnnotation): Unit
```

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

| Parameters |
|---|---|
| `annotation: https://developer.android.com/reference/kotlin/androidx/pdf/annotation/content/PdfAnnotation` | The finalized `https://developer.android.com/reference/kotlin/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)

```
fun onAnnotationError(throwable: Throwable): Unit
```

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

| Parameters |
|---|---|
| `throwable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` | The underlying cause of the failure. |