来源: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"…………………………………………………………………………