FragmentHostCallback
Integration points with the Fragment host.
Fragments may be hosted by any object; such as an Activity. In order to host fragments, implement FragmentHostCallback, overriding the methods applicable to the host.
FragmentManager changes its behavior based on what optional interfaces your FragmentHostCallback implements. This includes the following:
androidx.activity.result.ActivityResultRegistryOwner: Removes the need to override .onStartIntentSenderFromFragment or .onRequestPermissionsFromFragment.
FragmentOnAttachListener: Removes the need to manually call FragmentManager.addFragmentOnAttachListener from your host in order to receive FragmentOnAttachListener.onAttachFragment callbacks for the FragmentController.getSupportFragmentManager.
androidx.activity.OnBackPressedDispatcherOwner: Removes the need to manually call FragmentManager.popBackStackImmediate when handling the system back button.
androidx.lifecycle.ViewModelStoreOwner: Removes the need for your FragmentController to call FragmentController.retainNestedNonConfig or FragmentController.restoreAllState.
Parameters
the type of object that's currently hosting the fragments. An instance of this class must be returned by onGetHost.
Properties
Functions
Print internal state into the given stream.
Return the view with the given resource ID. May return null
if the view is not a child of this container.
Return the object that's currently hosting the fragment. If a Fragment is hosted by a FragmentActivity, the object returned here should be the same object returned from Fragment.getActivity.
Return a LayoutInflater. See Activity.getLayoutInflater.
Return the window animations.
Return true
if there are window animations.
Requests permissions from the given fragment. See FragmentActivity.requestPermissions
Return true
if the fragment's state needs to be saved.
Checks whether to show permission rationale UI from a fragment. See FragmentActivity.shouldShowRequestPermissionRationale
Starts a new Activity from the given fragment. See FragmentActivity.startActivityForResult.
Starts a new IntentSender from the given fragment. See Activity.startIntentSender.
Invalidates the activity's options menu. See FragmentActivity.supportInvalidateOptionsMenu