How do I make a setting to change the font size of all text in my app from preferences.
My preferences xml is
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:defaultValue="true"
android:key="check box"
android:summary="Screen stays on yes/no "
android:title="Display stays on"
/>
<ListPreference
android:title="Font Size"
android:key="Fontsize"
android:entries="@array/listarray"
android:entryValues="@array/listvalues"
android:defaultValue="3"
/>
and arrays
<string-array name="listarray">
<item>Very Small</item>
<item>Small</item>
<item>Medium</item>
<item>Large</item>
<item>XLarge</item>
</string-array>
<string-array name="listvalues">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
and preference.java
public class preference extends PreferenceActivity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content, new preferencefrag()).commit();
}
public static class preferencefrag extends PreferenceFragment {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference);
I want to change size of all text in the layouts off the app by the list preference