来源:http://www.verydemo.com/demo_c131_i51909.html
在使用PreferenceActivity的时候,布局文件的格式一般是这样的:
<PreferenceCategory android:title="@string/launch_preferences"> <!-- This PreferenceScreen tag sends the user to a new fragment of preferences. If running in a large screen, they can be embedded inside of the overall preferences UI. --> <PreferenceScreen android:fragment="com.example.android.apis.preference.PreferenceWithHeaders$Prefs1FragmentInner" android:title="@string/title_fragment_preference" android:summary="@string/summary_fragment_preference"> <!-- Arbitrary key/value pairs can be included for fragment arguments --> <extra android:name="someKey" android:value="somePrefValue" /> </PreferenceScreen> <!-- This PreferenceScreen tag sends the user to a completely different activity, switching out of the current preferences UI. --> <PreferenceScreen android:title="@string/title_intent_preference" android:summary="@string/summary_intent_preference"> <intent android:action="android.intent.action.VIEW" android:data="http://www.android.com"…………………………………………………………………………
本文介绍在Android应用中使用PreferenceActivity创建设置界面的方法。通过具体的XML布局文件示例,展示了如何组织偏好设置项,并利用PreferenceScreen及PreferenceCategory等元素实现不同类型的设置页面。
1234

被折叠的 条评论
为什么被折叠?



