public abstract class LeanbackSettingsFragment
extends Fragment
implements PreferenceFragment.OnPreferenceStartFragmentCallback, PreferenceFragment.OnPreferenceStartScreenCallback, PreferenceFragment.OnPreferenceDisplayDialogCallback
java.lang.Object | ||
↳ | android.app.Fragment | |
↳ | android.support.v17.preference.LeanbackSettingsFragment |
Inherited XML attributes |
|
---|---|
From class android.app.Fragment
|
Inherited constants |
---|
From interface android.content.ComponentCallbacks2
|
Public constructors |
|
---|---|
LeanbackSettingsFragment() |
Public methods |
|
---|---|
View |
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 调用以使片段实例化其用户界面视图。 |
void |
onPause() 当碎片不再恢复时调用。 |
boolean |
onPreferenceDisplayDialog(PreferenceFragment caller, Preference pref) |
abstract void |
onPreferenceStartInitialScreen() 调用实例化初始 |
void |
onResume() 当片段对用户可见且正在积极运行时调用。 |
void |
onViewCreated(View view, Bundle savedInstanceState) 在 |
void |
startImmersiveFragment(Fragment fragment) 向用户显示片段,暂时替换此片段的内容。 |
void |
startPreferenceFragment(Fragment fragment) 向用户显示偏好片段。 |
Inherited methods |
|
---|---|
From class android.app.Fragment
|
|
From class java.lang.Object
|
|
From interface android.content.ComponentCallbacks2
|
|
From interface android.view.View.OnCreateContextMenuListener
|
|
From interface android.support.v14.preference.PreferenceFragment.OnPreferenceStartFragmentCallback
|
|
From interface android.support.v14.preference.PreferenceFragment.OnPreferenceStartScreenCallback
|
|
From interface android.support.v14.preference.PreferenceFragment.OnPreferenceDisplayDialogCallback
|
|
From interface android.content.ComponentCallbacks
|
LeanbackSettingsFragment ()
View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
调用以使片段实例化其用户界面视图。 这是可选的,非图形片段可以返回null(这是默认实现)。 这将在onCreate(Bundle)
和onActivityCreated(Bundle)
之间onActivityCreated(Bundle)
。
如果你从这里返回一个视图,那么当视图被释放时,你将在 onDestroyView()
被调用。
Parameters | |
---|---|
inflater |
LayoutInflater : The LayoutInflater object that can be used to inflate any views in the fragment, |
container |
ViewGroup : If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view. |
savedInstanceState |
Bundle : If non-null, this fragment is being re-constructed from a previous saved state as given here. |
Returns | |
---|---|
View |
Return the View for the fragment's UI, or null. |
boolean onPreferenceDisplayDialog (PreferenceFragment caller, Preference pref)
Parameters | |
---|---|
caller |
PreferenceFragment
|
pref |
Preference
|
Returns | |
---|---|
boolean |
void onPreferenceStartInitialScreen ()
被调用以实例化初始PreferenceFragment
以显示在此片段中。 预计实现将调用startPreferenceFragment(android.app.Fragment)
。
void onViewCreated (View view, Bundle savedInstanceState)
在onCreateView(LayoutInflater, ViewGroup, Bundle)
已经返回之后立即调用,但在任何保存的状态恢复到视图之前。 这让子类有机会在知道其视图层次已完全创建后自行初始化。 此时片段的视图层次不会附加到其父项。
Parameters | |
---|---|
view |
View : The View returned by onCreateView(LayoutInflater, ViewGroup, Bundle) . |
savedInstanceState |
Bundle : If non-null, this fragment is being re-constructed from a previous saved state as given here. |
void startImmersiveFragment (Fragment fragment)
向用户显示片段,暂时替换此片段的内容。
Parameters | |
---|---|
fragment |
Fragment : Fragment instance to be added. |
void startPreferenceFragment (Fragment fragment)
向用户显示偏好片段。 此方法也可用于在首选片段堆栈顶部显示列表样式片段。
Parameters | |
---|---|
fragment |
Fragment : Fragment instance to be added. |