lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

androidx.fragment.app

Classes

DialogFragment

Static library support version of the framework's android.app.DialogFragment.

Fragment

Static library support version of the framework's android.app.Fragment.

FragmentActivity

Base class for activities that want to use the support-based Fragments.

FragmentContainer

Callbacks to a Fragment's container.

FragmentController

Provides integration points with a FragmentManager for a fragment host.

FragmentHostCallback

Integration points with the Fragment host.

FragmentManager

Static library support version of the framework's android.app.FragmentManager.

FragmentManagerNonConfig

FragmentManagerNonConfig stores the retained instance fragments across activity recreation events.

FragmentPagerAdapter

Implementation of PagerAdapter that represents each page as a Fragment that is persistently kept in the fragment manager as long as the user can return to the page.

FragmentStatePagerAdapter

Implementation of PagerAdapter that uses a Fragment to manage each page.

FragmentTabHost

Special TabHost that allows the use of Fragment objects for its tab content.

FragmentTransaction

Static library support version of the framework's android.app.FragmentTransaction.

ListFragment

Static library support version of the framework's android.app.ListFragment.

Extension functions summary

For FragmentManager
Unit
FragmentManager.transaction(now: Boolean = false, allowStateLoss: Boolean = false, body: FragmentTransaction.() -> Unit)

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

Extension functions

transaction

inline fun FragmentManager.transaction(now: Boolean = false, allowStateLoss: Boolean = false, body: FragmentTransaction.() -> Unit): Unit

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

One of four commit functions will be used based on the values of now and allowStateLoss:

| now | allowStateLoss | Method | | ----- | ---------------- | ------------------------------ | | false | false | commit() | | false | true | commitAllowingStateLoss() | | true | false | commitNow() | | true | true | commitNowAllowingStateLoss() |