I have two Android preference screens defined in an Android app in XML format.
For example, Screen 1
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="screen1"> <PreferenceCategory android:title="Preferences"> <CheckBoxPreference android:defaultValue="true" android:title="test" android:key="test_pref"/> </PreferenceCategory> </PreferenceScreen>
and screen 2
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="screen2"> <CheckBoxPreference android:key="checkbox" android:title="Checkbox"> </CheckBoxPreference> </PreferenceScreen>
I would like screen 2 to be a separate screen that would be accessible on its own, but I would also like its preferences to be part of the screen. Is there an easy way I can just refer to screen 2 from screen 1? Or I just need to essentially repeat the same preference stuff on the preferences screen on screen 1.
android reference xml preferencescreen
Tim
source share