FragmentActivity

public class FragmentActivity extends ComponentActivity implements ContextAware, LifecycleOwner, ViewModelStoreOwner, HasDefaultViewModelProviderFactory, LifecycleOwner, SavedStateRegistryOwner, LifecycleOwner, OnBackPressedDispatcherOwner, ActivityResultRegistryOwner, ActivityResultCaller, OnConfigurationChangedProvider, OnTrimMemoryProvider, OnNewIntentProvider, MenuHost, ActivityCompat.OnRequestPermissionsResultCallback

Object
   ↳ ComponentActivity
     ↳ FragmentActivity
Known direct subclasses
AppCompatActivity

Base class for activities that wish to use some of the newer platform features on older Android devices.

CarAppActivity

The class representing a car app activity.


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

Default constructor for FragmentActivity.

FragmentActivity(@LayoutRes int contentLayoutId)

Alternate constructor that can be used to provide a default layout that will be inflated as part of super.onCreate(savedInstanceState).

Public methods

@Override void
dump(
    @NonNull String prefix,
    @Nullable FileDescriptor fd,
    @NonNull PrintWriter writer,
    String[] args
)

Print the Activity's state into the given stream.

@NonNull FragmentManager

Return the FragmentManager for interacting with fragments associated with this activity.

@NonNull LoaderManager

This method is deprecated.

Use LoaderManager.getInstance(this).

@MainThread void