Most visited

Recently visited

FragmentHostCallback

public abstract class FragmentHostCallback
extends FragmentContainer

java.lang.Object
   ↳ android.support.v4.app.FragmentContainer
     ↳ android.support.v4.app.FragmentHostCallback<E>


集成点与片段主机。

片段可以由任何对象托管; Activity 为了托管碎片,实现FragmentHostCallback ,覆盖适用于主机的方法。

Summary

Public constructors

FragmentHostCallback(Context context, Handler handler, int windowAnimations)

Public methods

void onDump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

将内部状态打印到给定的流中。

View onFindViewById(int id)

使用给定的资源ID返回视图。

abstract E onGetHost()

返回当前托管该片段的对象。

LayoutInflater onGetLayoutInflater()

返回 LayoutInflater

int onGetWindowAnimations()

返回窗口动画。

boolean onHasView()

如果容器包含任何视图,则返回 true

boolean onHasWindowAnimations()

如果有窗口动画,则返回 true

void onRequestPermissionsFromFragment(Fragment fragment, String[] permissions, int requestCode)

请求给定片段的权限。

boolean onShouldSaveFragmentState(Fragment fragment)

如果片段的状态需要保存,则返回 true

boolean onShouldShowRequestPermissionRationale(String permission)

检查我们是否从片段中显示权限原理UI。

void onStartActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options)

从给定的片段开始新的 Activity

void onStartActivityFromFragment(Fragment fragment, Intent intent, int requestCode)

从给定的片段开始新的 Activity

void onStartIntentSenderFromFragment(Fragment fragment, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)

从给定片段开始新的 IntentSender

void onSupportInvalidateOptionsMenu()

使活动的选项菜单失效。

Inherited methods

From class android.support.v4.app.FragmentContainer
From class java.lang.Object

Public constructors

FragmentHostCallback

FragmentHostCallback (Context context, 
                Handler handler, 
                int windowAnimations)

Parameters
context Context
handler Handler
windowAnimations int

Public methods

onDump

void onDump (String prefix, 
                FileDescriptor fd, 
                PrintWriter writer, 
                String[] args)

将内部状态打印到给定的流中。

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

View onFindViewById (int id)

使用给定的资源ID返回视图。 如果视图不是此容器的子项,则可能返回null

Parameters
id int
Returns
View

onGetHost

E onGetHost ()

返回当前托管该片段的对象。 如果FragmentFragmentActivity ,则此处返回的对象应该是从getActivity()返回的同一对象。

Returns
E

onGetLayoutInflater

LayoutInflater onGetLayoutInflater ()

返回LayoutInflater getLayoutInflater()

Returns
LayoutInflater

onGetWindowAnimations

int onGetWindowAnimations ()

返回窗口动画。

Returns
int

onHasView

boolean onHasView ()

如果容器包含任何视图,则返回 true

Returns
boolean

onHasWindowAnimations

boolean onHasWindowAnimations ()

如果有窗口动画,则返回 true

Returns
boolean

onRequestPermissionsFromFragment

void onRequestPermissionsFromFragment (Fragment fragment, 
                String[] permissions, 
                int requestCode)

请求给定片段的权限。 requestPermissions(String[], int)

Parameters
fragment Fragment
permissions String
requestCode int

onShouldSaveFragmentState

boolean onShouldSaveFragmentState (Fragment fragment)

如果片段的状态需要保存,则返回 true

Parameters
fragment Fragment
Returns
boolean

onShouldShowRequestPermissionRationale

boolean onShouldShowRequestPermissionRationale (String permission)

检查我们是否从片段中显示权限原理UI。 shouldShowRequestPermissionRationale(String)

Parameters
permission String
Returns
boolean

onStartActivityFromFragment

void onStartActivityFromFragment (Fragment fragment, 
                Intent intent, 
                int requestCode, 
                Bundle options)

从给定的片段开始新的Activity startActivityForResult(Intent, int, Bundle)

Parameters
fragment Fragment
intent Intent
requestCode int
options Bundle

onStartActivityFromFragment

void onStartActivityFromFragment (Fragment fragment, 
                Intent intent, 
                int requestCode)

从给定的片段开始新的Activity startActivityForResult(Intent, int)

Parameters
fragment Fragment
intent Intent
requestCode int

onStartIntentSenderFromFragment

void onStartIntentSenderFromFragment (Fragment fragment, 
                IntentSender intent, 
                int requestCode, 
                Intent fillInIntent, 
                int flagsMask, 
                int flagsValues, 
                int extraFlags, 
                Bundle options)

从给定的片段开始新的IntentSender startIntentSender(IntentSender, Intent, int, int, int, Bundle)

Parameters
fragment Fragment
intent IntentSender
requestCode int
fillInIntent Intent
flagsMask int
flagsValues int
extraFlags int
options Bundle
Throws
IntentSender.SendIntentException

onSupportInvalidateOptionsMenu

void onSupportInvalidateOptionsMenu ()

使活动的选项菜单失效。 supportInvalidateOptionsMenu()

Hooray!