FragmentHostCallback
public
abstract
class
FragmentHostCallback
extends FragmentContainer
| java.lang.Object | ||
| ↳ | android.app.FragmentContainer | |
| ↳ | android.app.FragmentHostCallback<E> | |
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 | |
|---|---|
FragmentHostCallback(Context context, Handler handler, int windowAnimations)
|
|
Public methods | |
|---|---|
void
|
onAttachFragment(Fragment fragment)
Called when a |
void
|
onDump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)
Print internal state into the given stream. |
<T extends View>
T
|
onFindViewById(int id)
Return the view with the given resource ID. |
abstract
E
|
onGetHost()
Return the object that's currently hosting the fragment. |
LayoutInflater
|
onGetLayoutInflater()
Return a |
int
|
onGetWindowAnimations()
Return the window animations. |
boolean
|
onHasView()
Return |
boolean
|
onHasWindowAnimations()
Return |
void
|
onInvalidateOptionsMenu()
Invalidates the activity's options menu. |
void
|
onRequestPermissionsFromFragment(Fragment fragment, String[] permissions, int requestCode)
Requests permissions from the given fragment. |
boolean
|
onShouldSaveFragmentState(Fragment fragment)
Return |
void
|
onStartActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options)
Starts a new |
void
|
onStartIntentSenderFromFragment(Fragment fragment, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
Starts a new |
boolean
|
onUseFragmentManagerInflaterFactory()
Return |
Inherited methods | |
|---|---|
android.app.FragmentContainer
| |
java.lang.Object
| |
Public constructors
FragmentHostCallback
FragmentHostCallback (Context context, Handler handler, int windowAnimations)
| Parameters | |
|---|---|
context |
Context |
handler |
Handler |
windowAnimations |
int |
Public methods
onAttachFragment
void onAttachFragment (Fragment fragment)
Called when a Fragment is being attached to this host, immediately
after the call to its onAttach(Context) method and before
onCreate(Bundle).
| Parameters | |
|---|---|
fragment |
Fragment |
onDump
void onDump (String prefix, FileDescriptor fd, PrintWriter writer, String[] args)
Print internal state into the given stream.
| Parameters | |
|---|---|
prefix |
String: Desired prefix to prepend at each line of output. |
fd |
FileDescriptor: The raw file descriptor that the dump is being sent to. |
writer |
PrintWriter: 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.
|
onFindViewById
T onFindViewById (int id)
Return the view with the given resource ID. May return null if the
view is not a child of this container.
| Parameters | |
|---|---|
id |
int |
| Returns | |
|---|---|
T |
This value may be |
onGetHost
E onGetHost ()
Return the object that's currently hosting the fragment. If a Fragment
is hosted by a Activity, the object returned here should be the same
object returned from getActivity().
| Returns | |
|---|---|
E |
This value may be |
onGetLayoutInflater
LayoutInflater onGetLayoutInflater ()
Return a LayoutInflater.
See getLayoutInflater().
| Returns | |
|---|---|
LayoutInflater |
|
onGetWindowAnimations
int onGetWindowAnimations ()
Return the window animations.
| Returns | |
|---|---|
int |
|
onHasView
boolean onHasView ()
Return true if the container holds any view.
| Returns | |
|---|---|
boolean |
|
onHasWindowAnimations
boolean onHasWindowAnimations ()
Return true if there are window animations.
| Returns | |
|---|---|
boolean |
|
onInvalidateOptionsMenu
void onInvalidateOptionsMenu ()
Invalidates the activity's options menu.
See invalidateOptionsMenu()
onRequestPermissionsFromFragment
void onRequestPermissionsFromFragment (Fragment fragment, String[] permissions, int requestCode)
Requests permissions from the given fragment.
See requestPermissions(String[], int)
| Parameters | |
|---|---|
fragment |
Fragment This value must never be |
permissions |
String This value must never be |
requestCode |
int |
onShouldSaveFragmentState
boolean onShouldSaveFragmentState (Fragment fragment)
Return true if the fragment's state needs to be saved.
| Parameters | |
|---|---|
fragment |
Fragment |
| Returns | |
|---|---|
boolean |
|
onStartActivityFromFragment
void onStartActivityFromFragment (Fragment fragment, Intent intent, int requestCode, Bundle options)
Starts a new Activity from the given fragment.
See startActivityForResult(Intent, int).
| Parameters | |
|---|---|
fragment |
Fragment |
intent |
Intent |
requestCode |
int |
options |
Bundle |
onStartIntentSenderFromFragment
void onStartIntentSenderFromFragment (Fragment fragment, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
Starts a new IntentSender from the given fragment.
See startIntentSender(IntentSender, Intent, int, int, int, Bundle).
| Parameters | |
|---|---|
fragment |
Fragment |
intent |
IntentSender |
requestCode |
int |
fillInIntent |
Intent This value may be |
flagsMask |
int |
flagsValues |
int |
extraFlags |
int |
options |
Bundle |
| Throws | |
|---|---|
IntentSender.SendIntentException |
|
onUseFragmentManagerInflaterFactory
boolean onUseFragmentManagerInflaterFactory ()
Return true if the FragmentManager's LayoutInflaterFactory should be used.
| Returns | |
|---|---|
boolean |
|
Interfaces
- ActionBar.OnMenuVisibilityListener
- ActionBar.OnNavigationListener
- ActionBar.TabListener
- AlarmManager.OnAlarmListener
- Application.ActivityLifecycleCallbacks
- Application.OnProvideAssistDataListener
- AppOpsManager.OnOpChangedListener
- DatePickerDialog.OnDateSetListener
- FragmentBreadCrumbs.OnBreadCrumbClickListener
- FragmentManager.BackStackEntry
- FragmentManager.OnBackStackChangedListener
- KeyguardManager.OnKeyguardExitResult
- LoaderManager.LoaderCallbacks
- Notification.Action.Extender
- Notification.Extender
- PendingIntent.OnFinished
- SearchManager.OnCancelListener
- SearchManager.OnDismissListener
- SharedElementCallback.OnSharedElementsReadyListener
- TimePickerDialog.OnTimeSetListener
- UiAutomation.AccessibilityEventFilter
- UiAutomation.OnAccessibilityEventListener
Classes
- ActionBar
- ActionBar.LayoutParams
- ActionBar.Tab
- Activity
- ActivityGroup
- ActivityManager
- ActivityManager.AppTask
- ActivityManager.MemoryInfo
- ActivityManager.ProcessErrorStateInfo
- ActivityManager.RecentTaskInfo
- ActivityManager.RunningAppProcessInfo
- ActivityManager.RunningServiceInfo
- ActivityManager.RunningTaskInfo
- ActivityManager.TaskDescription
- ActivityOptions
- AlarmManager
- AlarmManager.AlarmClockInfo
- AlertDialog
- AlertDialog.Builder
- AliasActivity
- Application
- ApplicationErrorReport
- ApplicationErrorReport.AnrInfo
- ApplicationErrorReport.BatteryInfo
- ApplicationErrorReport.CrashInfo
- ApplicationErrorReport.RunningServiceInfo
- AppOpsManager
- AutomaticZenRule
- DatePickerDialog
- Dialog
- DialogFragment
- DownloadManager
- DownloadManager.Query
- DownloadManager.Request
- ExpandableListActivity
- Fragment
- Fragment.SavedState
- FragmentBreadCrumbs
- FragmentContainer
- FragmentController
- FragmentHostCallback
- FragmentManager
- FragmentManager.FragmentLifecycleCallbacks
- FragmentManagerNonConfig
- FragmentTransaction
- Instrumentation
- Instrumentation.ActivityMonitor
- Instrumentation.ActivityResult
- IntentService
- KeyguardManager
- KeyguardManager.KeyguardDismissCallback
- KeyguardManager.KeyguardLock
- LauncherActivity
- LauncherActivity.IconResizer
- LauncherActivity.ListItem
- ListActivity
- ListFragment
- LoaderManager
- LocalActivityManager
- MediaRouteActionProvider
- MediaRouteButton
- NativeActivity
- Notification
- Notification.Action
- Notification.Action.Builder
- Notification.Action.WearableExtender
- Notification.BigPictureStyle
- Notification.BigTextStyle
- Notification.Builder
- Notification.CarExtender
- Notification.CarExtender.Builder
- Notification.CarExtender.UnreadConversation
- Notification.DecoratedCustomViewStyle
- Notification.DecoratedMediaCustomViewStyle
- Notification.InboxStyle
- Notification.MediaStyle
- Notification.MessagingStyle
- Notification.MessagingStyle.Message
- Notification.Style
- Notification.WearableExtender
- NotificationChannel
- NotificationChannelGroup
- NotificationManager
- NotificationManager.Policy
- PendingIntent
- PictureInPictureParams
- PictureInPictureParams.Builder
- Presentation
- ProgressDialog
- RemoteAction
- RemoteInput
- RemoteInput.Builder
- SearchableInfo
- SearchManager
- Service
- SharedElementCallback
- TabActivity
- TaskStackBuilder
- TimePickerDialog
- UiAutomation
- UiModeManager
- VoiceInteractor
- VoiceInteractor.AbortVoiceRequest
- VoiceInteractor.CommandRequest
- VoiceInteractor.CompleteVoiceRequest
- VoiceInteractor.ConfirmationRequest
- VoiceInteractor.PickOptionRequest
- VoiceInteractor.PickOptionRequest.Option
- VoiceInteractor.Prompt
- VoiceInteractor.Request
- WallpaperInfo
- WallpaperManager
Exceptions