support-preference

How to use the v7/v14 Preference Support library?

依然范特西╮ 提交于 2019-12-17 10:22:10
问题 Together with the M release, there are new support libraries. One of them that seems to be very useful is the v7 Preference Support library. It does not seem to have PreferenceActivity or something similar, how do we integrate it to our app? 回答1: You have to extend AppCompatActivity , which is required for fragment, and include a subclass of PreferenceFragmentCompat. The abstract fragment requires to override one method, in which you should place your preference inflation logic. And last,

How to use the v7/v14 Preference Support library?

对着背影说爱祢 提交于 2019-11-27 10:51:19
Together with the M release, there are new support libraries. One of them that seems to be very useful is the v7 Preference Support library. It does not seem to have PreferenceActivity or something similar, how do we integrate it to our app? You have to extend AppCompatActivity , which is required for fragment, and include a subclass of PreferenceFragmentCompat . The abstract fragment requires to override one method, in which you should place your preference inflation logic. And last, your activity theme needs to specify a preferenceTheme attribute. Read the announcement here . With preference