# EditablePdfViewerFragment

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

*** ** * ** ***


```
@RequiresExtension(extension = 31, version = 18)
@ExperimentalPdfApi
open class EditablePdfViewerFragment : PdfViewerFragment
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.fragment.app.Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment) |||
|   | ↳ | [androidx.pdf.viewer.fragment.PdfViewerFragment](https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment) ||
|   |   | ↳ | [androidx.pdf.ink.EditablePdfViewerFragment](https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment) |

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment` that extends `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment` to provide PDF editing capabilities, including annotation and form filling, leveraging the 'androidx.ink' library.

This fragment coordinates the underlying PDF content with editing layers, enabling users to
add ink strokes, create annotations, and modify form fields. It manages the interaction logic
between viewing the document and performing edits.

**Editing Workflow:**

1. **Viewing:** Behaves exactly like \[PdfViewerFragment\].
2. **Editing:** When \[isEditModeEnabled\] is set to \`true\`, user can leverage editing capabilities(such as annotating or filling forms).
3. **Saving:** Edits are accumulated as "drafts". To persist changes, the host must call \[applyDraftEdits\], which asynchronously applies unsaved edits and creates a \[PdfWriteHandle\] used to write the modified document to a file.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment` |   |
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#applyDraftEdits()` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#EditablePdfViewerFragment()()` |

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#EditablePdfViewerFragment(androidx.pdf.viewer.fragment.PdfStylingOptions)(pdfStylingOptions: https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfStylingOptions)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#applyDraftEdits()()` Applies all draft edits to the document. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onApplyEditsFailed(kotlin.Throwable)(error: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` Callback invoked when applying draft edits has failed. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onApplyEditsSuccess(androidx.pdf.PdfWriteHandle)(handle: https://developer.android.com/reference/kotlin/androidx/pdf/PdfWriteHandle)` Callback invoked when draft edits have been successfully applied to the document. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onAttach(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Called when a fragment is first attached to its context. |
| `open https://developer.android.com/reference/android/view/View.html?` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)( inflater: https://developer.android.com/reference/android/view/LayoutInflater.html, container: https://developer.android.com/reference/android/view/ViewGroup.html?, savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html? )` Called to have the fragment instantiate its user interface view. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onDestroyView()()` Called when the view previously created by `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has been detached from the fragment. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onDetach()()` Called when the fragment is no longer attached to its activity. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onEnterEditMode()()` Callback invoked when `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` enters edit mode. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onExitEditMode()()` Callback invoked when `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` exits edit mode. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onViewCreated(android.view.View,android.os.Bundle)(view: https://developer.android.com/reference/android/view/View.html, savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?)` Called immediately after `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has returned, but before any saved state has been restored in to the view. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#hasUnsavedChanges()` Returns `true` if there are any draft edits that have not yet been applied to the document, `false` otherwise. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#isApplyEditsInProgress()` Returns `true` if an `applyDraftEdits` operation is currently in progress. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#isEditModeEnabled()` If `true`, the fragment is in edit mode, allowing for annotating or editing. |

### Inherited functions

From [androidx.fragment.app.Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(listener: https://developer.android.com/reference/kotlin/androidx/activity/contextaware/OnContextAvailableListener)`

Add a new `https://developer.android.com/reference/kotlin/androidx/activity/contextaware/OnContextAvailableListener` for receiving a callback for when this class is associated with a `https://developer.android.com/reference/android/content/Context.html`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])(
prefix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html,
fd: https://developer.android.com/reference/java/io/FileDescriptor.html?,
writer: https://developer.android.com/reference/java/io/PrintWriter.html,
args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>?
)`

Print the Fragments's state into the given stream.
`operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)`

Subclasses can not override equals().
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#getString(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Return a localized string from the application's package's default string table.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#getString(int,java.lang.Object...)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, vararg formatArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`

Return a localized formatted string from the application's package's default string table, substituting the format arguments as defined in `https://developer.android.com/reference/java/util/Formatter.html` and `https://developer.android.com/reference/java/lang/String.html#format(java.lang.String, java.lang.Object...)`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#getText(int)(resId: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Return a localized, styled CharSequence from the application's package's default string table.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#hashCode()()`

Subclasses can not override hashCode().
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[onActivityCreated](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onActivityCreated(android.os.Bundle))(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?)`

**This function is deprecated.**

use `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)` for code touching the view created by `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` and `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreate(android.os.Bundle)` for other initialization.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onActivityResult](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onActivityResult(int,int,android.content.Intent))(requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, data: https://developer.android.com/reference/android/content/Intent.html?)`

**This function is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[onAttach](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onAttach(android.app.Activity))(activity: https://developer.android.com/reference/android/app/Activity.html)`

**This function is deprecated.**

See `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onAttach(android.content.Context)`.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
[onAttachFragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onAttachFragment(androidx.fragment.app.Fragment))(childFragment: https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment)`

**This function is deprecated.**

The responsibility for listening for fragments being attached has been moved to FragmentManager.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onConfigurationChanged(android.content.res.Configuration)(newConfig: https://developer.android.com/reference/android/content/res/Configuration.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onContextItemSelected(android.view.MenuItem)(item: https://developer.android.com/reference/android/view/MenuItem.html)`

This hook is called whenever an item in a context menu is selected.
`https://developer.android.com/reference/android/view/animation/Animation.html?` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateAnimation(int,boolean,int)(transit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, enter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, nextAnim: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Called when a fragment loads an animation.
`https://developer.android.com/reference/android/animation/Animator.html?` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateAnimator(int,boolean,int)(transit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, enter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, nextAnim: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Called when a fragment loads an animator.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)(
menu: https://developer.android.com/reference/android/view/ContextMenu.html,
v: https://developer.android.com/reference/android/view/View.html,
menuInfo: https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html?
)`

Called when a context menu for the `view` is about to be shown.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
[onCreateOptionsMenu](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater))(menu: https://developer.android.com/reference/android/view/Menu.html, inflater: https://developer.android.com/reference/android/view/MenuInflater.html)`

**This function is deprecated.**

`https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onDestroy()()`

Called when the fragment is no longer in use.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
[onDestroyOptionsMenu](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onDestroyOptionsMenu())()`

**This function is deprecated.**

`https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`https://developer.android.com/reference/android/view/LayoutInflater.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onGetLayoutInflater(android.os.Bundle)(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?)`

Returns the LayoutInflater used to inflate Views of this Fragment.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onHiddenChanged(boolean)(hidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Called when the hidden state (as returned by `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isHidden()` of the fragment or another fragment in its hierarchy has changed.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[onInflate](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onInflate(android.app.Activity,android.util.AttributeSet,android.os.Bundle))(
activity: https://developer.android.com/reference/android/app/Activity.html,
attrs: https://developer.android.com/reference/android/util/AttributeSet.html,
savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?
)`

**This function is deprecated.**

See `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)`.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onLowMemory()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onMultiWindowModeChanged(boolean)(isInMultiWindowMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Called when the Fragment's activity changes from fullscreen mode to multi-window mode and visa-versa.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
[onOptionsItemSelected](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onOptionsItemSelected(android.view.MenuItem))(item: https://developer.android.com/reference/android/view/MenuItem.html)`

**This function is deprecated.**

`https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
[onOptionsMenuClosed](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onOptionsMenuClosed(android.view.Menu))(menu: https://developer.android.com/reference/android/view/Menu.html)`

**This function is deprecated.**

`https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onPause()()`

Called when the Fragment is no longer resumed.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onPictureInPictureModeChanged(boolean)(isInPictureInPictureMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Called by the system when the activity changes to and from picture-in-picture mode.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
[onPrepareOptionsMenu](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onPrepareOptionsMenu(android.view.Menu))(menu: https://developer.android.com/reference/android/view/Menu.html)`

**This function is deprecated.**

`https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/kotlin/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onPrimaryNavigationFragmentChanged(boolean)(
isPrimaryNavigationFragment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html
)`

Callback for when the primary navigation state of this Fragment has changed.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onRequestPermissionsResult](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onRequestPermissionsResult(int,java.lang.String[],int[]))(
requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
permissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>,
grantResults: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html
)`

**This function is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onSaveInstanceState(android.os.Bundle)(outState: https://developer.android.com/reference/android/os/Bundle.html)`

Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance if its process is restarted.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onStart()()`

Called when the Fragment is visible to the user.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onStop()()`

Called when the Fragment is no longer started.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onViewStateRestored(android.os.Bundle)(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?)`

Called when all saved state has been restored into the view hierarchy of the fragment.
`https://developer.android.com/reference/android/content/Context.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#peekAvailableContext()()`

Get the `https://developer.android.com/reference/android/content/Context.html` if it is currently available.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#postponeEnterTransition()()`

Postpone the entering Fragment transition until `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startPostponedEnterTransition()` or `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager#executePendingTransactions()` has been called.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#postponeEnterTransition(long,java.util.concurrent.TimeUnit)(duration: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, timeUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)`

Postpone the entering Fragment transition for a given amount of time and then call `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startPostponedEnterTransition()`.
`https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<I>` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultCallback<O>)(
contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>,
callback: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCallback<O>
)`


Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`.

<br />

`https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<I>` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback<O>)(
contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>,
registry: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultRegistry,
callback: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCallback<O>
)`

Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#registerForContextMenu(android.view.View)(view: https://developer.android.com/reference/android/view/View.html)`

Registers a context menu to be shown for the given view (multiple views can show the context menu).
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(listener: https://developer.android.com/reference/kotlin/androidx/activity/contextaware/OnContextAvailableListener)`

Remove a `https://developer.android.com/reference/kotlin/androidx/activity/contextaware/OnContextAvailableListener` previously added via `https://developer.android.com/reference/kotlin/androidx/activity/contextaware/ContextAware#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[requestPermissions](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requestPermissions(java.lang.String[],int))(permissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentActivity` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireActivity()()`

Return the `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentActivity` this fragment is currently associated with.
`https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireArguments()()`

Return the arguments supplied when the fragment was instantiated.
`https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireContext()()`

Return the `https://developer.android.com/reference/android/content/Context.html` this fragment is currently associated with.
`https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager` `[requireFragmentManager](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireFragmentManager())()`

**This function is deprecated.**

This has been renamed to `getParentFragmentManager()` to make it clear that you are accessing the FragmentManager that contains this Fragment and not the FragmentManager associated with child Fragments.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireHost()()`

Return the host object of this fragment.
`https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireParentFragment()()`

Returns the parent Fragment containing this Fragment.
`https://developer.android.com/reference/android/view/View.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#requireView()()`

Get the root view for the fragment's layout (the one returned by `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`).
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#setEnterSharedElementCallback(androidx.core.app.SharedElementCallback)(callback: https://developer.android.com/reference/kotlin/androidx/core/app/SharedElementCallback?)`

When custom transitions are used with Fragments, the enter transition callback is called when this Fragment is attached or detached when not popping the back stack.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#setExitSharedElementCallback(androidx.core.app.SharedElementCallback)(callback: https://developer.android.com/reference/kotlin/androidx/core/app/SharedElementCallback?)`

When custom transitions are used with Fragments, the exit transition callback is called when this Fragment is attached or detached when popping the back stack.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setHasOptionsMenu](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#setHasOptionsMenu(boolean))(hasMenu: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**

This method is no longer needed when using a `https://developer.android.com/reference/kotlin/androidx/core/view/MenuProvider` to provide a `https://developer.android.com/reference/android/view/Menu.html` to your activity, which replaces `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)` as the recommended way to provide a consistent, optionally `https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle`-aware, and modular way to handle menu creation and item selection.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#setInitialSavedState(androidx.fragment.app.Fragment.SavedState)(state: https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.SavedState?)`

Set the initial saved state that this Fragment should restore itself from when first being constructed, as returned by `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager#saveFragmentInstanceState(androidx.fragment.app.Fragment)`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#setMenuVisibility(boolean)(menuVisible: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Set a hint for whether this fragment's menu should be visible.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setTargetFragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#setTargetFragment(androidx.fragment.app.Fragment,int))(fragment: https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment?, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**

Instead of using a target fragment to pass results, the fragment requesting a result should use `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)` to register a `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentResultListener` with a `
requestKey` using its `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#getParentFragmentManager()`.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#shouldShowRequestPermissionRationale(java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`

Gets whether you should show UI with rationale before requesting a permission.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startActivity(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)`

Call `https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)` from the fragment's containing Activity.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startActivity(android.content.Intent,android.os.Bundle)(intent: https://developer.android.com/reference/android/content/Intent.html, options: https://developer.android.com/reference/android/os/Bundle.html?)`

Call `https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent, android.os.Bundle)` from the fragment's containing Activity.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startActivityForResult](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startActivityForResult(android.content.Intent,int))(intent: https://developer.android.com/reference/android/content/Intent.html, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startActivityForResult](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startActivityForResult(android.content.Intent,int,android.os.Bundle))(intent: https://developer.android.com/reference/android/content/Intent.html, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, options: https://developer.android.com/reference/android/os/Bundle.html?)`

**This function is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startIntentSenderForResult](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startIntentSenderForResult(android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle))(
intent: https://developer.android.com/reference/android/content/IntentSender.html,
requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
fillInIntent: https://developer.android.com/reference/android/content/Intent.html?,
flagsMask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
flagsValues: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
extraFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
options: https://developer.android.com/reference/android/os/Bundle.html?
)`

**This function is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#startPostponedEnterTransition()()`

Begin postponed transitions after `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#postponeEnterTransition()` was called.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#toString()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#unregisterForContextMenu(android.view.View)(view: https://developer.android.com/reference/android/view/View.html)`

Prevents a context menu to be shown for the given view.
From [androidx.pdf.viewer.fragment.PdfViewerFragment](https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onCreate(android.os.Bundle)(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?)`

Called to do initial creation of a fragment.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)(
context: https://developer.android.com/reference/android/content/Context.html,
attrs: https://developer.android.com/reference/android/util/AttributeSet.html,
savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?
)`

Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity.
`open https://developer.android.com/reference/kotlin/androidx/pdf/ocr/OcrProvider?` `@https://developer.android.com/reference/kotlin/androidx/pdf/ExperimentalPdfApi
https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onInitOcrProvider()()`

Invoked when the `https://developer.android.com/reference/kotlin/androidx/pdf/ocr/OcrProvider` is needed for recognizing text in image-based PDF content.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onLinkClicked(androidx.pdf.content.ExternalLink)(externalLink: https://developer.android.com/reference/kotlin/androidx/pdf/content/ExternalLink)`

Called when an external link in the PDF is clicked.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentError(kotlin.Throwable)(error: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)`

Invoked when a problem arises during the loading process of the PDF document.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentSuccess(androidx.pdf.PdfDocument)(document: https://developer.android.com/reference/kotlin/androidx/pdf/PdfDocument)`

Invoked when the document has been fully loaded and processed.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/pdf/ExperimentalPdfApi
https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onPdfViewCreated(androidx.pdf.view.PdfView)(pdfView: https://developer.android.com/reference/kotlin/androidx/pdf/view/PdfView)`

Invoked when underlying `https://developer.android.com/reference/kotlin/androidx/pdf/view/PdfView` implementation has been created.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onRequestImmersiveMode(kotlin.Boolean)(enterImmersive: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Called when the PDF view wants to enter or exit immersive mode based on user's interaction with the content.
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#onResume()()`

Called when the fragment is visible to the user and actively running.

### Inherited properties

From [androidx.fragment.app.Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment) `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentActivity?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#activity()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#allowEnterTransitionOverlap()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#allowReturnTransitionOverlap()` `https://developer.android.com/reference/android/os/Bundle.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#arguments()` `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#childFragmentManager()` `open https://developer.android.com/reference/android/content/Context.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#context()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#enterTransition()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#exitTransition()` `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#fragmentManager()`

**This property is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#host()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#id()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isAdded()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isDetached()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isHidden()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isInLayout()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isRemoving()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isResumed()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isStateSaved()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#isVisible()` `https://developer.android.com/reference/android/view/LayoutInflater.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#layoutInflater()` `open https://developer.android.com/reference/kotlin/androidx/loader/app/LoaderManager` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#loaderManager()`

**This property is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#parentFragment()` `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#parentFragmentManager()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#reenterTransition()` `https://developer.android.com/reference/android/content/res/Resources.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#resources()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#retainInstance()`

**This property is deprecated.** Deprecated in Java
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#returnTransition()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#sharedElementEnterTransition()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#sharedElementReturnTransition()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#tag()` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#targetFragment()`

**This property is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#targetRequestCode()`

**This property is deprecated.** Deprecated in Java
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#userVisibleHint()`

**This property is deprecated.** Deprecated in Java
`open https://developer.android.com/reference/android/view/View.html?` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#view()` `open https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#viewLifecycleOwner()` `open https://developer.android.com/reference/kotlin/androidx/lifecycle/LiveData<https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner>` `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#viewLifecycleOwnerLiveData()` From [androidx.lifecycle.HasDefaultViewModelProviderFactory](https://developer.android.com/reference/kotlin/androidx/lifecycle/HasDefaultViewModelProviderFactory) `open https://developer.android.com/reference/kotlin/androidx/lifecycle/viewmodel/CreationExtras` `https://developer.android.com/reference/kotlin/androidx/lifecycle/HasDefaultViewModelProviderFactory#defaultViewModelCreationExtras()` `open https://developer.android.com/reference/kotlin/androidx/lifecycle/ViewModelProvider.Factory` `https://developer.android.com/reference/kotlin/androidx/lifecycle/HasDefaultViewModelProviderFactory#defaultViewModelProviderFactory()` From [androidx.lifecycle.LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner) `open https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle` `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner#lifecycle()` From [androidx.pdf.viewer.fragment.PdfViewerFragment](https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment) `https://developer.android.com/reference/android/net/Uri.html?` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#documentUri()`

The URI of the PDF document to display defaulting to `null`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#isTextSearchActive()`

Controls whether text search mode is active.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment#isToolboxVisible()`

Indicates whether the toolbox should be visible.
From [androidx.savedstate.SavedStateRegistryOwner](https://developer.android.com/reference/kotlin/androidx/savedstate/SavedStateRegistryOwner) `https://developer.android.com/reference/kotlin/androidx/savedstate/SavedStateRegistry` `https://developer.android.com/reference/kotlin/androidx/savedstate/SavedStateRegistryOwner#savedStateRegistry()` From [androidx.lifecycle.ViewModelStoreOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/ViewModelStoreOwner) `open https://developer.android.com/reference/kotlin/androidx/lifecycle/ViewModelStore` `https://developer.android.com/reference/kotlin/androidx/lifecycle/ViewModelStoreOwner#viewModelStore()`

## Public constructors

### EditablePdfViewerFragment

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

```
EditablePdfViewerFragment()
```

## Protected constructors

### EditablePdfViewerFragment

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

```
protected EditablePdfViewerFragment(pdfStylingOptions: PdfStylingOptions)
```

## Public functions

### applyDraftEdits

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

```
fun applyDraftEdits(): Unit
```

Applies all draft edits to the document.

This operation executes asynchronously. The operation will be terminated if `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` is removed from the fragment manager while an `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#applyDraftEdits()` is in progress. `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` internally disallows editing capabilities during complete operation. Upon completion, either `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onApplyEditsSuccess(androidx.pdf.PdfWriteHandle)` or `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#onApplyEditsFailed(kotlin.Throwable)` will be invoked with the result.

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/model/ApplyInProgressException` | if another apply operation is already in progress. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | Operation supported above S+ device with sdk-ext \>= 18 |

### onApplyEditsFailed

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

```
open fun onApplyEditsFailed(error: Throwable): Unit
```

Callback invoked when applying draft edits has failed.

| Parameters |
|---|---|
| `error: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` | The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` that caused the failure. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#applyDraftEdits()` |   |

### onApplyEditsSuccess

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

```
open fun onApplyEditsSuccess(handle: PdfWriteHandle): Unit
```

Callback invoked when draft edits have been successfully applied to the document.

The host should override this method to perform the write operation. The provided `https://developer.android.com/reference/kotlin/androidx/pdf/PdfWriteHandle` allows writing the document changes to a `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html`. The handle **must** be closed after writing to ensure proper resource cleanup.

After the write operation is complete, the host is responsible for exiting the edit mode by setting `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#isEditModeEnabled()` to `false`.

| Parameters |
|---|---|
| `handle: https://developer.android.com/reference/kotlin/androidx/pdf/PdfWriteHandle` | A `https://developer.android.com/reference/kotlin/androidx/pdf/PdfWriteHandle` to be used for writing the changes to a file. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#applyDraftEdits()` |   |

### onAttach

```
open fun onAttach(context: Context): Unit
```

Called when a fragment is first attached to its context. `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreate(android.os.Bundle)` will be called after this.

### onCreateView

```
open fun onCreateView(
    inflater: LayoutInflater,
    container: ViewGroup?,
    savedInstanceState: Bundle?
): View?
```

Called to have the fragment instantiate its user interface view. This is optional, and non-graphical fragments can return null. This will be called between `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreate(android.os.Bundle)` and `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)`.

A default View can be returned by calling `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#Fragment(int)` in your constructor. Otherwise, this method returns null.

It is recommended to **only** inflate the layout in this method and move logic that operates on the returned View to `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)`.

If you return a View from here, you will later be called in `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onDestroyView()` when the view is being released.

| Parameters |
|---|---|
| `inflater: https://developer.android.com/reference/android/view/LayoutInflater.html` | The LayoutInflater object that can be used to inflate any views in the fragment, |
| `container: https://developer.android.com/reference/android/view/ViewGroup.html?` | If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view. |
| `savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?` | If non-null, this fragment is being re-constructed from a previous saved state as given here. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/view/View.html?` | Return the View for the fragment's UI, or null. |

### onDestroyView

```
open fun onDestroyView(): Unit
```

Called when the view previously created by `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has been detached from the fragment. The next time the fragment needs to be displayed, a new view will be created. This is called after `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onStop()` and before `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onDestroy()`. It is called *regardless* of whether `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` returned a non-null view. Internally it is called after the view's state has been saved but before it has been removed from its parent.

### onDetach

```
open fun onDetach(): Unit
```

Called when the fragment is no longer attached to its activity. This is called after `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onDestroy()`.

### onEnterEditMode

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

```
open fun onEnterEditMode(): Unit
```

Callback invoked when `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` enters edit mode. This is triggered when the user begins an edit for example modifying a form field or interaction via toolbox.

This callback can be used by the developers to make any UI changes required when the user
enters edit mode, e.g. showing the "Save" button to the user.

### onExitEditMode

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

```
open fun onExitEditMode(): Unit
```

Callback invoked when `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` exits edit mode. This is triggered when the edit mode is disabled and the fragment completes cleaning up it's edit state.

This callback can be used by the developers to make any UI changes required when the user
exits edit mode e.g. hiding the "Save" button.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#isEditModeEnabled()` |   |

### onViewCreated

```
open fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit
```

Called immediately after `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has returned, but before any saved state has been restored in to the view. This gives subclasses a chance to initialize themselves once they know their view hierarchy has been completely created. The fragment's view hierarchy is not however attached to its parent at this point.

| Parameters |
|---|---|
| `view: https://developer.android.com/reference/android/view/View.html` | The View returned by `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`. |
| `savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?` | If non-null, this fragment is being re-constructed from a previous saved state as given here. |

## Public properties

### hasUnsavedChanges

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

```
val hasUnsavedChanges: Boolean
```

Returns `true` if there are any draft edits that have not yet been applied to the document, `false` otherwise.

This can be used to prompt the user to save changes before navigating away, as draft edits will be lost if the fragment is removed from the stack or comes out of edit mode.

### isApplyEditsInProgress

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

```
val isApplyEditsInProgress: Boolean
```

Returns `true` if an `applyDraftEdits` operation is currently in progress.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment#applyDraftEdits()` |   |

### isEditModeEnabled

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

```
var isEditModeEnabled: Boolean
```

If `true`, the fragment is in edit mode, allowing for annotating or editing. If `false`, the fragment is in viewing mode.

Note: The host is responsible for setting this to `false` after a write operation is complete.