欢迎参加我们将于 6 月 3 日举行的 #Android11:Beta 版发布会

OnPreferenceStartFragmentCallback

interface OnPreferenceStartFragmentCallback
androidx.preference.PreferenceFragment.OnPreferenceStartFragmentCallback

Interface that the fragment's containing activity should implement to be able to process preference items that wish to switch to a specified fragment.

Summary

Public methods

abstract Boolean

Called when the user has clicked on a Preference that has a fragment class name associated with it.

Public methods

onPreferenceStartFragment

abstract fun onPreferenceStartFragment(
    caller: PreferenceFragment!,
    pref: Preference!
): Boolean

Called when the user has clicked on a Preference that has a fragment class name associated with it. The implementation should instantiate and switch to an instance of the given fragment.

Parameters
caller PreferenceFragment!: The fragment requesting navigation
pref Preference!: The preference requesting the fragment
Return
Boolean true if the fragment creation has been handled