> 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/annotation-list-a.md).

# Display list of all annotations in document

Discover how to use the AnnotationDialogFragment to manage annotations in a PDF document with ease. Learn how to show, listen for events, and set read-only access for annotations. Optimize your PDF vi

The [`AnnotationDialogFragment`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/controls/AnnotationDialogFragment.html) displays a list of all annotations in a document being viewed by a [`PDFViewCtrl`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/PDFViewCtrl.html). The list also contains any comments that have been added to the annotations.

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-47fffd5031d4592a346729695d0f7ad798a72552%2F8deb824fe864a598e715847f2700a0e82ce82401-1080x2160.png?alt=media)

## Show annotation dialog

To show an annotation dialog fragment in your activity, create a new instance of [`AnnotationDialogFragment`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/controls/AnnotationDialogFragment.html) by calling `newInstance()` and setting the [`PDFViewCtrl`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/PDFViewCtrl.html):

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

```java
BookmarksDialogFragment showBookmarksDialog(FragmentManager fragmentManager, PDFViewCtrl pdfViewCtrl) {
    DialogFragmentTab annotationsDialog = new DialogFragmentTab(
        AnnotationDialogFragment.class,
        BookmarksTabLayout.TAG_TAB_ANNOTATION,
        null,
        "Annotations",
        "Bookmarks Dialog",
        null);
    ArrayList<DialogFragmentTab> dialogFragmentTabs = new ArrayList<>();
    dialogFragmentTabs.add(annotationsDialog);

    BookmarksDialogFragment bookmarksDialog = BookmarksDialogFragment.newInstance();
    bookmarksDialog.setPdfViewCtrl(pdfViewCtrl)
        .setDialogFragmentTabs(dialogFragmentTabs);
    bookmarksDialog.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.PDFTronAppTheme);   
    bookmarksDialog.show(fragmentManager, "bookmarks_dialog");
    return bookmarksDialog;
}
```

{% endcode %}
{% endtab %}

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

```kotlin
fun showBookmarksDialog(fragmentManager: FragmentManager, pdfViewCtrl: PDFViewCtrl): BookmarksDialogFragment {
    val annotationsDialog = DialogFragmentTab(
        AnnotationDialogFragment::class.java!!,
        BookmarksTabLayout.TAG_TAB_ANNOTATION,
        null,
        "Annotations",
        "Bookmarks Dialog", null)
    val dialogFragmentTabs = ArrayList<DialogFragmentTab>()
    dialogFragmentTabs.add(annotationsDialog)
    
    val bookmarksDialog = BookmarksDialogFragment.newInstance()
    bookmarksDialog.setPdfViewCtrl(pdfViewCtrl)
                   .setDialogFragmentTabs(dialogFragmentTabs)
    bookmarksDialog.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.PDFTronAppTheme)
    bookmarksDialog.show(fragmentManager, "bookmarks_dialog")
    return bookmarksDialog
}
```

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

## Listener

By calling `setAnnotationDialogListener(AnnotationDialogListener)`, you can set a listener to be notified when an annotation item is clicked, or when document annotations are exported to a PDF doc when users click on the export floating action button.

## Read-only

If the document has write access, users can delete existing annotations by long-pressing on the annotation. To specify whether the document is read-only call `setReadOnly(boolean)`.


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/android/annotation/annotation-list-a.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
