FragmentHostCallback

abstract class FragmentHostCallback<E : Any!> : FragmentContainer
kotlin.Any
   ↳ androidx.fragment.app.FragmentContainer
   ↳ androidx.fragment.app.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.

Summary

Public constructors
<init>(context: Context, handler: Handler, windowAnimations: Int)

Public methods
open Unit
onStartActivityFromFragment(fragment: Fragment!, intent: Intent!, requestCode: Int)

Starts a new Activity from the given fragment.

open Unit
onStartActivityFromFragment(fragment: Fragment!, intent: Intent!, requestCode: Int, options: Bundle?)

Starts a new Activity from the given fragment.

abstract E?

Return the object that's currently hosting the fragment.

open LayoutInflater

Return a LayoutInflater.

open Int

Return the window animations.

open Boolean

Checks whether to show permission rationale UI from a fragment.

open Boolean

Return true if there are window animations.

open Unit
onDump(prefix: String!, fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!)

Print internal state into the given stream.

open Unit
onStartIntentSenderFromFragment(fragment: Fragment!, intent: IntentSender!, requestCode: Int, fillInIntent: Intent?, flagsMask: Int, flagsValues: Int, extraFlags: Int, options: Bundle!)

Starts a new IntentSender from the given fragment.

open Unit

Invalidates the activity's options menu.

open Boolean

open Unit
onRequestPermissionsFromFragment(fragment: Fragment, permissions: Array<String!>, requestCode: Int)

Requests permissions from the given fragment.

open Boolean

Return true if the fragment's state needs to be saved.

open View?

Inherited functions

Public constructors

<init>

FragmentHostCallback(context: Context, handler: Handler, windowAnimations: Int)

Public methods

onStartActivityFromFragment

open fun onStartActivityFromFragment(fragment: Fragment!, intent: Intent!, requestCode: Int): Unit

Starts a new Activity from the given fragment. See FragmentActivity#startActivityForResult(Intent, int).

onStartActivityFromFragment

open fun onStartActivityFromFragment(fragment: Fragment!, intent: Intent!, requestCode: Int, options: Bundle?): Unit

Starts a new Activity from the given fragment. See FragmentActivity#startActivityForResult(Intent, int, Bundle).

onGetHost

abstract fun onGetHost(): E?

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().

onGetLayoutInflater

open fun onGetLayoutInflater(): LayoutInflater

Return a LayoutInflater. See Activity#getLayoutInflater().

onGetWindowAnimations

open fun onGetWindowAnimations(): Int

Return the window animations.

onShouldShowRequestPermissionRationale

open fun onShouldShowRequestPermissionRationale(permission: String): Boolean

Checks whether to show permission rationale UI from a fragment. See FragmentActivity#shouldShowRequestPermissionRationale(String)

onHasWindowAnimations

open fun onHasWindowAnimations(): Boolean

Return true if there are window animations.

onDump

open fun onDump(prefix: String!, fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!): Unit

Print internal state into the given stream.

Parameters
prefix String!: Desired prefix to prepend at each line of output.
fd String!: The raw file descriptor that the dump is being sent to.
writer String!: The PrintWriter to which you should dump your state. This will be closed for you after you return.
args String!: additional arguments to the dump request.

onStartIntentSenderFromFragment

open fun onStartIntentSenderFromFragment(fragment: Fragment!, intent: IntentSender!, requestCode: Int, fillInIntent: Intent?, flagsMask: Int, flagsValues: Int, extraFlags: Int, options: Bundle!): Unit

Starts a new IntentSender from the given fragment. See Activity#startIntentSender(IntentSender, Intent, int, int, int, Bundle).

onSupportInvalidateOptionsMenu

open fun onSupportInvalidateOptionsMenu(): Unit

Invalidates the activity's options menu. See FragmentActivity#supportInvalidateOptionsMenu()

onHasView

open fun onHasView(): Boolean

onRequestPermissionsFromFragment

open fun onRequestPermissionsFromFragment(fragment: Fragment, permissions: Array<String!>, requestCode: Int): Unit

Requests permissions from the given fragment. See FragmentActivity#requestPermissions(String[], int)

onShouldSaveFragmentState

open fun onShouldSaveFragmentState(fragment: Fragment!): Boolean

Return true if the fragment's state needs to be saved.

onFindViewById

open fun onFindViewById(id: Int): View?