/** * Interface definition for a callback to be invoked when a * {@link Preference} in the hierarchy rooted at this * {@link PreferenceScreen} is * clicked. * * @hide */ publicinterfaceOnPreferenceTreeClickListener{ /** * Called when a preference in the tree rooted at this * {@link PreferenceScreen} has been clicked. * * @param preferenceScreen The {@link PreferenceScreen} that the * preference is located in. * @param preference The preference that was clicked. * @return Whether the click was handled. */ booleanonPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference); }
0x03 完成步骤
通过新建项目的方式:
在android-studio里,新建一个项目:PreferenceFragmentDemo
选择Blank Activity With Fragment,填写activity为SettingActivity。