belongs to Maven artifact com.android.support:support-fragment:28.0.0-alpha1
FragmentActivity
public
class
FragmentActivity
extends Activity
implements
LifecycleOwner,
ViewModelStoreOwner,
ActivityCompat.OnRequestPermissionsResultCallback
java.lang.Object | |||||
↳ | android.content.Context | ||||
↳ | android.content.ContextWrapper | ||||
↳ | android.view.ContextThemeWrapper | ||||
↳ | android.app.Activity | ||||
↳ | android.support.v4.app.FragmentActivity |
![]() |
Base class for activities that want to use the support-based
Fragment
and
Loader
APIs.
When using this class as opposed to new platform's built-in fragment
and loader support, you must use the getSupportFragmentManager()
and getSupportLoaderManager()
methods respectively to access
those features.
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
Inherited constants |
---|
![]()
android.app.Activity
|
![]()
android.content.Context
|
![]()
android.content.ComponentCallbacks2
|
Inherited fields |
---|
![]()
android.app.Activity
|
Public constructors | |
---|---|
FragmentActivity()
|
Public methods | |
---|---|
void
|
dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)
Print the Activity's state into the given stream. |
Object
|
getLastCustomNonConfigurationInstance()
Return the value previously returned from
|
Lifecycle
|
getLifecycle()
Returns the Lifecycle of the provider. |
FragmentManager
|
getSupportFragmentManager()
Return the FragmentManager for interacting with fragments associated with this activity. |
LoaderManager
|
getSupportLoaderManager()
|
ViewModelStore
|
getViewModelStore()
Returns the |
void
|
onAttachFragment(Fragment fragment)
Called when a fragment is attached to the activity. |
void
|
onBackPressed()
Take care of popping the fragment back stack or finishing the activity as appropriate. |
void
|
onConfigurationChanged(Configuration newConfig)
Dispatch configuration change to all fragments. |
boolean
|
onCreatePanelMenu(int featureId, Menu menu)
Dispatch to Fragment.onCreateOptionsMenu(). |
View
|
onCreateView(View parent, String name, Context context, AttributeSet attrs)
|
View
|
onCreateView(String name, Context context, AttributeSet attrs)
|
void
|
onLowMemory()
Dispatch onLowMemory() to all fragments. |
boolean
|
onMenuItemSelected(int featureId, MenuItem item)
Dispatch context and options menu to fragments. |
void
|
onMultiWindowModeChanged(boolean isInMultiWindowMode)
Note: If you override this method you must call
|
void
|
onPanelClosed(int featureId, Menu menu)
Call onOptionsMenuClosed() on fragments. |
void
|
onPictureInPictureModeChanged(boolean isInPictureInPictureMode)
Note: If you override this method you must call
|
boolean
|
onPreparePanel(int featureId, View view, Menu menu)
Dispatch onPrepareOptionsMenu() to fragments. |
void
|
onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
Callback for the result from requesting permissions. |
Object
|
onRetainCustomNonConfigurationInstance()
Use this instead of |
final
Object
|
onRetainNonConfigurationInstance()
Retain all appropriate fragment state. |
void
|
onStateNotSaved()
Hook in to note that fragment state is no longer saved. |
void
|
setEnterSharedElementCallback(SharedElementCallback callback)
When |
void
|
setExitSharedElementCallback(SharedElementCallback listener)
When |
void
|
startActivityForResult(Intent intent, int requestCode, Bundle options)
|
void
|
startActivityForResult(Intent intent, int requestCode)
Modifies the standard behavior to allow results to be delivered to fragments. |
void
|
startActivityFromFragment(Fragment fragment, Intent intent, int requestCode)
Called by Fragment.startActivityForResult() to implement its behavior. |
void
|
startActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options)
Called by Fragment.startActivityForResult() to implement its behavior. |
void
|
startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
|
void
|
startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
|
void
|
startIntentSenderFromFragment(Fragment fragment, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
Called by Fragment.startIntentSenderForResult() to implement its behavior. |
void
|
supportFinishAfterTransition()
Reverses the Activity Scene entry Transition and triggers the calling Activity to reverse its exit Transition. |
void
|
supportInvalidateOptionsMenu()
This method was deprecated
in API level 26.1.0.
Call |
void
|
supportPostponeEnterTransition()
Support library version of |
void
|
supportStartPostponedEnterTransition()
Support library version of |
final
void
|
validateRequestPermissionsRequestCode(int requestCode)
|
Protected methods | |
---|---|
void
|
onActivityResult(int requestCode, int resultCode, Intent data)
Dispatch incoming result to the correct fragment. |
void
|
onCreate(Bundle savedInstanceState)
Perform initialization of all fragments. |
void
|
onDestroy()
Destroy all fragments. |
void
|
onNewIntent(Intent intent)
Handle onNewIntent() to inform the fragment manager that the state is not saved. |
void
|
onPause()
Dispatch onPause() to fragments. |
void
|
onPostResume()
Dispatch onResume() to fragments. |
void
|
onResume()
Dispatch onResume() to fragments. |
void
|
onResumeFragments()
This is the fragment-orientated version of |
void
|
onSaveInstanceState(Bundle outState)
Save all appropriate fragment state. |
void
|
onStart()
Dispatch onStart() to all fragments. |
void
|
onStop()
Dispatch onStop() to all fragments. |
Inherited methods | |
---|---|
![]()
android.app.Activity
|