# PdfViewerFragment

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

*** ** * ** ***


```
public class PdfViewerFragment extends Fragment
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.fragment.app.Fragment](https://developer.android.com/reference/androidx/fragment/app/Fragment) ||
|   | ↳ | [androidx.pdf.viewer.fragment.PdfViewerFragment](https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment) |

Known direct subclasses [EditablePdfViewerFragment](https://developer.android.com/reference/androidx/pdf/ink/EditablePdfViewerFragment)

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

*** ** * ** ***

A Fragment that renders a PDF document.

A \[PdfViewerFragment\] that can display paginated PDFs. The viewer includes a FAB for
annotation support and a search menu. Each page is rendered in its own View. Upon creation, this
fragment displays a loading spinner.

Rendering is done in 2 passes:

1. Layout: Request the page data, get the dimensions and set them as measure for the image view.
2. Render: Create bitmap(s) at adequate dimensions and attach them to the page view.

The layout pass is progressive: starts with a few first pages of the document, then reach
further as the user scrolls down (and ultimately spans the whole document). The rendering pass is
tightly limited to the currently visible pages. Pages that are scrolled past (become not visible)
have their bitmaps released to free up memory.

Note that every activity/fragment that uses this class has to be themed with Theme.AppCompat
or a theme that extends that theme.

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#PdfViewerFragment()()` |

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#PdfViewerFragment(androidx.pdf.viewer.fragment.PdfStylingOptions)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfStylingOptions pdfStylingOptions)` Protected constructor for instantiating a `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` with the specified styling options. |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#getDocumentUri()()` The URI of the PDF document to display defaulting to `null`. |
| `final boolean` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#isTextSearchActive()()` Controls whether text search mode is active. |
| `final boolean` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#isToolboxVisible()()` Indicates whether the toolbox should be visible. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#newInstance(androidx.pdf.viewer.fragment.PdfStylingOptions)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfStylingOptions pdfStylingOptions)` Creates a new instance of `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` with the specified styling options. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onCreate(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` Called to do initial creation of a fragment. |
| `https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/LayoutInflater.html inflater, https://developer.android.com/reference/android/view/ViewGroup.html container, https://developer.android.com/reference/android/os/Bundle.html savedInstanceState )` Called to have the fragment instantiate its user interface view. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onDestroyView()()` Called when the view previously created by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has been detached from the fragment. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/AttributeSet.html attrs, https://developer.android.com/reference/android/os/Bundle.html savedInstanceState )` Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity. |
| `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` | `@https://developer.android.com/reference/androidx/pdf/ExperimentalPdfApi https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onInitOcrProvider()()` Invoked when the `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` is needed for recognizing text in image-based PDF content. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentError(kotlin.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html error)` Invoked when a problem arises during the loading process of the PDF document. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentSuccess(androidx.pdf.PdfDocument)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/PdfDocument document)` Invoked when the document has been fully loaded and processed. |
| `void` | `@https://developer.android.com/reference/androidx/pdf/ExperimentalPdfApi https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onPdfViewCreated(androidx.pdf.view.PdfView)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/view/PdfView pdfView)` Invoked when underlying `https://developer.android.com/reference/androidx/pdf/view/PdfView` implementation has been created. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onRequestImmersiveMode(kotlin.Boolean)(boolean enterImmersive)` Called when the PDF view wants to enter or exit immersive mode based on user's interaction with the content. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onResume()()` Called when the fragment is visible to the user and actively running. |
| `void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onViewCreated(android.view.View,android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view, https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` Called immediately after `https://developer.android.com/reference/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. |
| `final void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#setDocumentUri(android.net.Uri)(https://developer.android.com/reference/android/net/Uri.html value)` The URI of the PDF document to display defaulting to `null`. |
| `final void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#setTextSearchActive(kotlin.Boolean)(boolean value)` Controls whether text search mode is active. |
| `final void` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#setToolboxVisible(kotlin.Boolean)(boolean value)` Indicates whether the toolbox should be visible. |

| ### Protected methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLinkClicked(androidx.pdf.content.ExternalLink)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/content/ExternalLink externalLink)` Called when an external link in the PDF is clicked. |

### Inherited methods

From [androidx.fragment.app.Fragment](https://developer.android.com/reference/androidx/fragment/app/Fragment) `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener listener
)`

Add a new `https://developer.android.com/reference/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`.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html prefix,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/io/FileDescriptor.html fd,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/PrintWriter.html writer,
String[] args
)`

Print the Fragments's state into the given stream.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html o)`

Subclasses can not override equals().
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getActivity()()` `boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getAllowEnterTransitionOverlap()()` `boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getAllowReturnTransitionOverlap()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getArguments()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getChildFragmentManager()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getContext()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` `@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#getDefaultViewModelCreationExtras()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getDefaultViewModelProviderFactory()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getEnterTransition()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getExitTransition()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `[getFragmentManager](https://developer.android.com/reference/androidx/fragment/app/Fragment#getFragmentManager())()`

**This method is deprecated.** Deprecated in Java
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getHost()()` `final int` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getId()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getLayoutInflater()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/Lifecycle` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getLifecycle()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/loader/app/LoaderManager` `[getLoaderManager](https://developer.android.com/reference/androidx/fragment/app/Fragment#getLoaderManager())()`

**This method is deprecated.** Deprecated in Java
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getParentFragment()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getParentFragmentManager()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getReenterTransition()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Resources.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getResources()()` `final boolean` `[getRetainInstance](https://developer.android.com/reference/androidx/fragment/app/Fragment#getRetainInstance())()`

**This method is deprecated.** Deprecated in Java
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getReturnTransition()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/savedstate/SavedStateRegistry` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getSavedStateRegistry()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getSharedElementEnterTransition()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getSharedElementReturnTransition()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getString(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId)`

Return a localized string from the application's package's default string table.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getString(int,java.lang.Object...)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html... formatArgs)`

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...)`.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getTag()()` `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `[getTargetFragment](https://developer.android.com/reference/androidx/fragment/app/Fragment#getTargetFragment())()`

**This method is deprecated.** Deprecated in Java
`final int` `[getTargetRequestCode](https://developer.android.com/reference/androidx/fragment/app/Fragment#getTargetRequestCode())()`

**This method is deprecated.** Deprecated in Java
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getText(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId)`

Return a localized, styled CharSequence from the application's package's default string table.
`boolean` `[getUserVisibleHint](https://developer.android.com/reference/androidx/fragment/app/Fragment#getUserVisibleHint())()`

**This method is deprecated.** Deprecated in Java
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getView()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewLifecycleOwner()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/LiveData<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner>` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewLifecycleOwnerLiveData()()` `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/ViewModelStore` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewModelStore()()` `final int` `https://developer.android.com/reference/androidx/fragment/app/Fragment#hashCode()()`

Subclasses can not override hashCode().
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isAdded()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isDetached()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isHidden()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isInLayout()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isRemoving()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isResumed()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isStateSaved()()` `final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isVisible()()` `void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
[onActivityCreated](https://developer.android.com/reference/androidx/fragment/app/Fragment#onActivityCreated(android.os.Bundle))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**

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

<br />

`void` `[onActivityResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#onActivityResult(int,int,android.content.Intent))(int requestCode, int resultCode, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html data)`

**This method 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/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
[onAttach](https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.app.Activity))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Activity.html activity)`

**This method is deprecated.**

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

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)`

Called when a fragment is first attached to its context.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onAttachFragment](https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttachFragment(androidx.fragment.app.Fragment))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/Fragment childFragment)`

**This method is deprecated.**

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

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onConfigurationChanged(android.content.res.Configuration)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Configuration.html newConfig)` `boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onContextItemSelected(android.view.MenuItem)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/MenuItem.html item)`

This hook is called whenever an item in a context menu is selected.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/animation/Animation.html` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateAnimation(int,boolean,int)(int transit, boolean enter, int nextAnim)`

Called when a fragment loads an animation.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/animation/Animator.html` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateAnimator(int,boolean,int)(int transit, boolean enter, int nextAnim)`

Called when a fragment loads an animator.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ContextMenu.html menu,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html v,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html menuInfo
)`

Called when a context menu for the `view` is about to be shown.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onCreateOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/Menu.html menu, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/MenuInflater.html inflater)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/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/androidx/activity/ComponentActivity#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onDestroy()()`

Called when the fragment is no longer in use.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onDestroyOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#onDestroyOptionsMenu())()`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/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/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onDetach()()`

Called when the fragment is no longer attached to its activity.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#onGetLayoutInflater(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

Returns the LayoutInflater used to inflate Views of this Fragment.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onHiddenChanged(boolean)(boolean hidden)`

Called when the hidden state (as returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#isHidden()` of the fragment or another fragment in its hierarchy has changed.
`void` `@https://developer.android.com/reference/androidx/annotation/UiThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
[onInflate](https://developer.android.com/reference/androidx/fragment/app/Fragment#onInflate(android.app.Activity,android.util.AttributeSet,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Activity.html activity,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/util/AttributeSet.html attrs,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState
)`

**This method is deprecated.**

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

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onLowMemory()()`

**This method is deprecated.**
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#onMultiWindowModeChanged(boolean)(boolean isInMultiWindowMode)`

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

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/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/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onOptionsMenuClosed](https://developer.android.com/reference/androidx/fragment/app/Fragment#onOptionsMenuClosed(android.view.Menu))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/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/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onPause()()`

Called when the Fragment is no longer resumed.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#onPictureInPictureModeChanged(boolean)(boolean isInPictureInPictureMode)`

Called by the system when the activity changes to and from picture-in-picture mode.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onPrepareOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#onPrepareOptionsMenu(android.view.Menu))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/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/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onPrimaryNavigationFragmentChanged(boolean)(
boolean isPrimaryNavigationFragment
)`

Callback for when the primary navigation state of this Fragment has changed.
`void` `[onRequestPermissionsResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#onRequestPermissionsResult(int,java.lang.String[],int[]))(
int requestCode,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] permissions,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html int[] grantResults
)`

**This method 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/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onSaveInstanceState(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html outState)`

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.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onStart()()`

Called when the Fragment is visible to the user.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onStop()()`

Called when the Fragment is no longer started.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onViewStateRestored(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

Called when all saved state has been restored into the view hierarchy of the fragment.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#peekAvailableContext()()`

Get the `https://developer.android.com/reference/android/content/Context.html` if it is currently available.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#postponeEnterTransition()()`

Postpone the entering Fragment transition until `https://developer.android.com/reference/androidx/fragment/app/Fragment#startPostponedEnterTransition()` or `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#executePendingTransactions()` has been called.
`final void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#postponeEnterTransition(long,java.util.concurrent.TimeUnit)(long duration, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/TimeUnit.html timeUnit)`

Postpone the entering Fragment transition for a given amount of time and then call `https://developer.android.com/reference/androidx/fragment/app/Fragment#startPostponedEnterTransition()`.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultLauncher<@https://developer.android.com/reference/androidx/annotation/NonNull I>` `@https://developer.android.com/reference/androidx/annotation/MainThread
<I extends https://developer.android.com/reference/java/lang/Object.html, O extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/fragment/app/Fragment#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultCallback<O>)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull I, @https://developer.android.com/reference/androidx/annotation/NonNull O> contract,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultCallback<@https://developer.android.com/reference/androidx/annotation/NonNull O> callback
)`


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/androidx/activity/result/contract/ActivityResultContract`.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultLauncher<@https://developer.android.com/reference/androidx/annotation/NonNull I>` `@https://developer.android.com/reference/androidx/annotation/MainThread
<I extends https://developer.android.com/reference/java/lang/Object.html, O extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/fragment/app/Fragment#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback<O>)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull I, @https://developer.android.com/reference/androidx/annotation/NonNull O> contract,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultRegistry registry,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultCallback<@https://developer.android.com/reference/androidx/annotation/NonNull O> callback
)`

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/androidx/activity/result/contract/ActivityResultContract`.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#registerForContextMenu(android.view.View)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view)`

Registers a context menu to be shown for the given view (multiple views can show the context menu).
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener listener
)`

Remove a `https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener` previously added via `https://developer.android.com/reference/androidx/activity/contextaware/ContextAware#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)`.
`final void` `[requestPermissions](https://developer.android.com/reference/androidx/fragment/app/Fragment#requestPermissions(java.lang.String[],int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] permissions, int requestCode)`

**This method 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/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireActivity()()`

Return the `https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` this fragment is currently associated with.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireArguments()()`

Return the arguments supplied when the fragment was instantiated.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireContext()()`

Return the `https://developer.android.com/reference/android/content/Context.html` this fragment is currently associated with.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `[requireFragmentManager](https://developer.android.com/reference/androidx/fragment/app/Fragment#requireFragmentManager())()`

**This method 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 />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireHost()()`

Return the host object of this fragment.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireParentFragment()()`

Returns the parent Fragment containing this Fragment.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireView()()`

Get the root view for the fragment's layout (the one returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`).
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setAllowEnterTransitionOverlap(boolean)(boolean allow)` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setAllowReturnTransitionOverlap(boolean)(boolean allow)` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setArguments(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html args)` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setEnterSharedElementCallback(androidx.core.app.SharedElementCallback)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/SharedElementCallback callback)`

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.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setEnterTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setExitSharedElementCallback(androidx.core.app.SharedElementCallback)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/SharedElementCallback callback)`

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.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setExitTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)` `void` `[setHasOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#setHasOptionsMenu(boolean))(boolean hasMenu)`

**This method is deprecated.**

This method is no longer needed when using a `https://developer.android.com/reference/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/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/androidx/lifecycle/Lifecycle`-aware, and modular way to handle menu creation and item selection.

<br />

`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setInitialSavedState(androidx.fragment.app.Fragment.SavedState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment.SavedState state)`

Set the initial saved state that this Fragment should restore itself from when first being constructed, as returned by `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#saveFragmentInstanceState(androidx.fragment.app.Fragment)`.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setMenuVisibility(boolean)(boolean menuVisible)`

Set a hint for whether this fragment's menu should be visible.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setReenterTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)` `void` `[setRetainInstance](https://developer.android.com/reference/androidx/fragment/app/Fragment#setRetainInstance(boolean))(boolean retain)`

**This method is deprecated.** Deprecated in Java
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setReturnTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setSharedElementEnterTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setSharedElementReturnTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)` `void` `[setTargetFragment](https://developer.android.com/reference/androidx/fragment/app/Fragment#setTargetFragment(androidx.fragment.app.Fragment,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment fragment, int requestCode)`

**This method is deprecated.**

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

<br />

`void` `[setUserVisibleHint](https://developer.android.com/reference/androidx/fragment/app/Fragment#setUserVisibleHint(boolean))(boolean isVisibleToUser)`

**This method is deprecated.** Deprecated in Java
`boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#shouldShowRequestPermissionRationale(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html permission)`

Gets whether you should show UI with rationale before requesting a permission.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivity(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)`

Call `https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)` from the fragment's containing Activity.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivity(android.content.Intent,android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html options)`

Call `https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent, android.os.Bundle)` from the fragment's containing Activity.
`void` `[startActivityForResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivityForResult(android.content.Intent,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent, int requestCode)`

**This method 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/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `[startActivityForResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivityForResult(android.content.Intent,int,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent,
int requestCode,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html options
)`

**This method 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/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `[startIntentSenderForResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#startIntentSenderForResult(android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/IntentSender.html intent,
int requestCode,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html fillInIntent,
int flagsMask,
int flagsValues,
int extraFlags,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html options
)`

**This method 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/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#startPostponedEnterTransition()()`

Begin postponed transitions after `https://developer.android.com/reference/androidx/fragment/app/Fragment#postponeEnterTransition()` was called.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#toString()()` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#unregisterForContextMenu(android.view.View)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view)`

Prevents a context menu to be shown for the given view.

## Public constructors

### PdfViewerFragment

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

```
public PdfViewerFragment()
```

## Protected constructors

### PdfViewerFragment

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

```
protected PdfViewerFragment(@NonNull PdfStylingOptions pdfStylingOptions)
```

Protected constructor for instantiating a `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` with the specified styling options.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfStylingOptions pdfStylingOptions` | The styling options to be applied to the PDF viewer. |

## Public methods

### getDocumentUri

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

```
public final Uri getDocumentUri()
```

The URI of the PDF document to display defaulting to `null`.

When this property is set, the fragment begins loading the PDF document. A visual indicator is displayed while the document is being loaded. Once the loading is fully completed, the `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentSuccess(androidx.pdf.PdfDocument)` callback is invoked. If an error occurs during the loading phase, the `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentError(kotlin.Throwable)` callback is invoked with the exception.

<br />

##### Accepts the following URI schemes:

<br />

- content (\[android.content.ContentResolver.SCHEME_CONTENT\])
- file (\[android.content.ContentResolver.SCHEME_FILE\])


Setting a different URI will cancel any ongoing load operation, reset the fragment's state,
and display a loading indicator until the new content is loaded.


If the same URI is set multiple times, the load operation will not be restarted. Instead, the
existing load operation will continue.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the uri is not allowed. |

### isTextSearchActive

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

```
public final boolean isTextSearchActive()
```

Controls whether text search mode is active. Defaults to false.

When text search mode is activated, the search menu becomes visible, and search functionality is enabled. Deactivating text search mode hides the search menu, clears search results, and removes any search-related highlights.

Note: This property can only be set after the document has successfully loaded
i.e.\[onLoadDocumentSuccess\] is triggered. Any attempts to change it beforehand will have no
effect.

### isToolboxVisible

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

```
public final boolean isToolboxVisible()
```

Indicates whether the toolbox should be visible.

The host app can control this property to show/hide the toolbox based on its state and the `onRequestImmersiveMode` callback. The setter updates the UI elements within the fragment accordingly.

### newInstance

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

```
public static final @NonNull PdfViewerFragment newInstance(@NonNull PdfStylingOptions pdfStylingOptions)
```

Creates a new instance of `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` with the specified styling options.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfStylingOptions pdfStylingOptions` | The styling options to be applied. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` | A new instance of `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment` with the provided styling options. |

### onCreate

```
public void onCreate(Bundle savedInstanceState)
```

Called to do initial creation of a fragment. This is called after `https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.app.Activity)` and before `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`.

Note that this can be called while the fragment's activity is still in the process of being created. As such, you can not rely on things like the activity's content view hierarchy being initialized at this point. If you want to do work once the activity itself is created, add a `https://developer.android.com/reference/androidx/lifecycle/LifecycleObserver` on the activity's Lifecycle, removing it when it receives the `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.State#CREATED` callback.

Any restored child fragments will be created before the base `Fragment.onCreate` method returns.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If the fragment is being re-created from a previous saved state, this is the state. |

### onCreateView

```
public View onCreateView(
    @NonNull LayoutInflater inflater,
    ViewGroup container,
    Bundle savedInstanceState
)
```

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/androidx/fragment/app/Fragment#onCreate(android.os.Bundle)` and `https://developer.android.com/reference/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)`.

A default View can be returned by calling `https://developer.android.com/reference/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/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/androidx/fragment/app/Fragment#onDestroyView()` when the view is being released.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/LayoutInflater.html inflater` | The LayoutInflater object that can be used to inflate any views in the fragment, |
| `https://developer.android.com/reference/android/view/ViewGroup.html container` | 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. |
| `https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | 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

```
public void onDestroyView()
```

Called when the view previously created by `https://developer.android.com/reference/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/androidx/fragment/app/Fragment#onStop()` and before `https://developer.android.com/reference/androidx/fragment/app/Fragment#onDestroy()`. It is called *regardless* of whether `https://developer.android.com/reference/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.

### onInflate

```
public void onInflate(
    @NonNull Context context,
    @NonNull AttributeSet attrs,
    Bundle savedInstanceState
)
```

Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity. This may be called immediately after the fragment is created from a `https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView` in a layout file. Note this is *before* the fragment's `https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.content.Context)` has been called; all you should do here is parse the attributes and save them away.

This is called *the first time* the fragment is inflated. If it is being inflated into a new instance with saved state, this method will not be called a second time for the restored state fragment.

Here is a typical implementation of a fragment that can take parameters both through attributes supplied here as well from `https://developer.android.com/reference/androidx/fragment/app/Fragment#getArguments()`:

```java
public static class MyFragment extends Fragment {
    CharSequence mLabel;

    /**
     * Create a new instance of MyFragment that will be initialized
     * with the given arguments.
     */
    static MyFragment newInstance(CharSequence label) {
        MyFragment f = new MyFragment();
        Bundle b = new Bundle();
        b.putCharSequence("label", label);
        f.setArguments(b);
        return f;
    }

    /**
     * Parse attributes during inflation from a view hierarchy into the
     * arguments we handle.
     */
    @Override
    public void onInflate(@NonNull Context context, @NonNull AttributeSet attrs,
            @Nullable Bundle savedInstanceState) {
        super.onInflate(context, attrs, savedInstanceState);

        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.FragmentArguments);
        mLabel = a.getText(R.styleable.FragmentArguments_android_label);
        a.recycle();
    }

    /**
     * During creation, if arguments have been supplied to the fragment
     * then parse those out.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Bundle args = getArguments();
        if (args != null) {
            CharSequence label = args.getCharSequence("label");
            if (label != null) {
                mLabel = label;
            }
        }
    }

    /**
     * Create the view for this fragment, using the arguments given to it.
     */
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.hello_world, container, false);
        View tv = v.findViewById(R.id.text);
        ((TextView)tv).setText(mLabel != null ? mLabel : "(no label)");
        ViewCompat.setBackground(
                tv, ContextCompat.getDrawable(getContext(), android.R.drawable.gallery_thumb));
        return v;
    }
}
```

Note that parsing the XML attributes uses a "styleable" resource. The declaration for the styleable used here is:

```xml
<declare-styleable name="FragmentArguments">
    <attr name="android:label" />
</declare-styleable>
```

The fragment can then be declared within its activity's content layout through a tag like this:

```xml
<androidx.fragment.app.FragmentContainerView
        class="com.example.android.supportv4.app.FragmentArgumentsSupport$MyFragment"
        android:id="@+id/embedded"
        android:layout_width="0px" android:layout_height="wrap_content"
        android:layout_weight="1"
        android:label="@string/fragment_arguments_embedded" />
```

This fragment can also be created dynamically from arguments given at runtime in the arguments Bundle; here is an example of doing so at creation of the containing activity:

```java
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_arguments_support);

    if (savedInstanceState == null) {
        // First-time init; create fragment to embed in activity.
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        Fragment newFragment = MyFragment.newInstance("From Arguments");
        ft.add(R.id.created, newFragment);
        ft.commit();
    }
}
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | The Activity that is inflating this fragment. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/AttributeSet.html attrs` | The attributes at the tag where the fragment is being created. |
| `https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If the fragment is being re-created from a previous saved state, this is the state. |

### onInitOcrProvider

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

```
@ExperimentalPdfApi
public OcrProvider onInitOcrProvider()
```

Invoked when the `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` is needed for recognizing text in image-based PDF content. Subclasses can override this method to provide a custom `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` implementation.

The fragment takes ownership of the returned `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` and will call its `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider#close()` method when it's no longer needed (e.g., when the fragment is destroyed)

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` | The `https://developer.android.com/reference/androidx/pdf/ocr/OcrProvider` instance to be used, or `null` if OCR (Optical Character Recognition) is not supported or desired. |

### onLoadDocumentError

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

```
public void onLoadDocumentError(@NonNull Throwable error)
```

Invoked when a problem arises during the loading process of the PDF document. This callback provides details about the encountered error, allowing for appropriate error handling and user notification.

Note that this callback is dispatched only when the fragment is fully created and not yet
destroyed, i.e., after \[onCreate\] has fully run and before \[onDestroy\] runs, and only on the
main thread.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html error` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` that occurred during document loading. |

### onLoadDocumentSuccess

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

```
public void onLoadDocumentSuccess(@NonNull PdfDocument document)
```

Invoked when the document has been fully loaded and processed.

Note that this callback is dispatched only when the fragment is fully created and not yet
destroyed, i.e., after \[onCreate\] has fully run and before \[onDestroy\] runs, and only on the
main thread.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/PdfDocument document` | The `https://developer.android.com/reference/androidx/pdf/PdfDocument` instance representing the loaded PDF content. This reference will be valid till a new `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#documentUri()` is set or the fragment is destroyed. |

### onPdfViewCreated

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

```
@ExperimentalPdfApi
public void onPdfViewCreated(@NonNull PdfView pdfView)
```

Invoked when underlying `https://developer.android.com/reference/androidx/pdf/view/PdfView` implementation has been created. This allows subclasses to configure `https://developer.android.com/reference/androidx/pdf/view/PdfView` and set listeners for appropriate callbacks.

\[PdfView.pdfDocument\] is internally managed by fragment and setting any arbitrary
\[androidx.pdf.PdfDocument\] is not supported.

The \[PdfView\] is owned and managed by \[PdfViewerFragment\]. Clients should not directly
modify the view in response to user interactions, as this may interfere with the fragment's
internal behavior and event handling.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/view/PdfView pdfView` | : The `https://developer.android.com/reference/androidx/pdf/view/PdfView` instance created by `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment`. |

### onRequestImmersiveMode

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

```
public void onRequestImmersiveMode(boolean enterImmersive)
```

Called when the PDF view wants to enter or exit immersive mode based on user's interaction with the content. Apps would typically hide their top bar or other navigational interface when in immersive mode. The default implementation keeps toolbox visibility in sync with the enterImmersive mode. It is recommended that apps keep this behaviour by calling super.onRequestImmersiveMode while overriding this method.

| Parameters |
|---|---|
| `boolean enterImmersive` | true to enter immersive mode, false to exit. |

### onResume

```
public void onResume()
```

Called when the fragment is visible to the user and actively running. This is generally tied to `https://developer.android.com/reference/android/app/Activity.html#onResume()` of the containing Activity's lifecycle.

### onViewCreated

```
public void onViewCreated(@NonNull View view, Bundle savedInstanceState)
```

Called immediately after `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view` | The View returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`. |
| `https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If non-null, this fragment is being re-constructed from a previous saved state as given here. |

### setDocumentUri

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

```
public final void setDocumentUri(Uri value)
```

The URI of the PDF document to display defaulting to `null`.

When this property is set, the fragment begins loading the PDF document. A visual indicator is displayed while the document is being loaded. Once the loading is fully completed, the `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentSuccess(androidx.pdf.PdfDocument)` callback is invoked. If an error occurs during the loading phase, the `https://developer.android.com/reference/androidx/pdf/viewer/fragment/PdfViewerFragment#onLoadDocumentError(kotlin.Throwable)` callback is invoked with the exception.

<br />

##### Accepts the following URI schemes:

<br />

- content (\[android.content.ContentResolver.SCHEME_CONTENT\])
- file (\[android.content.ContentResolver.SCHEME_FILE\])


Setting a different URI will cancel any ongoing load operation, reset the fragment's state,
and display a loading indicator until the new content is loaded.


If the same URI is set multiple times, the load operation will not be restarted. Instead, the
existing load operation will continue.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the uri is not allowed. |

### setTextSearchActive

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

```
public final void setTextSearchActive(boolean value)
```

Controls whether text search mode is active. Defaults to false.

When text search mode is activated, the search menu becomes visible, and search functionality is enabled. Deactivating text search mode hides the search menu, clears search results, and removes any search-related highlights.

Note: This property can only be set after the document has successfully loaded
i.e.\[onLoadDocumentSuccess\] is triggered. Any attempts to change it beforehand will have no
effect.

### setToolboxVisible

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

```
public final void setToolboxVisible(boolean value)
```

Indicates whether the toolbox should be visible.

The host app can control this property to show/hide the toolbox based on its state and the `onRequestImmersiveMode` callback. The setter updates the UI elements within the fragment accordingly.

## Protected methods

### onLinkClicked

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

```
protected boolean onLinkClicked(@NonNull ExternalLink externalLink)
```

Called when an external link in the PDF is clicked. Override this method to provide custom handling for external links (e.g., URLs).

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/content/ExternalLink externalLink` | The `https://developer.android.com/reference/androidx/pdf/content/ExternalLink` model representing the clicked link. |

| Returns |
|---|---|
| `boolean` | `true` if the link click was handled; `false` to fall back to the default behaviour. |