FragmentActivity
open class FragmentActivity : ComponentActivity, ActivityCompat.OnRequestPermissionsResultCallback, RequestPermissionsRequestCodeValidator
androidx.activity.ComponentActivity | |
↳ | androidx.fragment.app.FragmentActivity |
Base class for activities that want to use the support-based Fragments
.
Known limitations:
-
When using the
<fragment>
tag, this implementation can not use the parent view's ID as the new fragment's ID. You must explicitly specify an ID (or tag) in the<fragment>
.
Summary
Public constructors | |
---|---|
<init>() Default constructor for FragmentActivity. |
|
Alternate constructor that can be used to provide a default layout that will be inflated as part of |
Public methods | |
---|---|
open Unit |
dump(@NonNull prefix: String, @Nullable fd: FileDescriptor?, @NonNull writer: PrintWriter, @Nullable args: Array<String!>?) Print the Activity's state into the given stream. |
open FragmentManager |
Return the FragmentManager for interacting with fragments associated with this activity. |
open LoaderManager | |
open Unit |
onAttachFragment(@NonNull fragment: Fragment) Called when a fragment is attached to the activity. |
open Unit |
onConfigurationChanged(@NonNull newConfig: Configuration) Dispatch configuration change to all fragments. |
open Boolean |
onCreatePanelMenu(featureId: Int, @NonNull : Menu) Dispatch to Fragment. |
open View? |
onCreateView(@Nullable parent: View?, @NonNull name: String, @NonNull context: Context, @NonNull attrs: AttributeSet) |
open View? |
onCreateView(@NonNull name: String, @NonNull context: Context, @NonNull attrs: AttributeSet) |
open Unit |
Dispatch onLowMemory() to all fragments. |
open Boolean |
onMenuItemSelected(featureId: Int, @NonNull item: MenuItem) Dispatch context and options menu to fragments. |
open Unit |
onMultiWindowModeChanged(isInMultiWindowMode: Boolean) Note: If you override this method you must call |
open Unit |
onPanelClosed(featureId: Int, @NonNull : Menu) Call onOptionsMenuClosed() on fragments. |
open Unit |
onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) Note: If you override this method you must call |
open Boolean |
onPreparePanel(featureId: Int, @Nullable view: View?, @NonNull : Menu) Dispatch onPrepareOptionsMenu() to fragments. |
open Unit |
onRequestPermissionsResult(requestCode: Int, @NonNull permissions: Array<String!>, @NonNull grantResults: IntArray) |
open Unit |
Hook in to note that fragment state is no longer saved. |