title: changing font size on activity through android preferences
body: <p>I have an issue, I am trying to resize fonts based on the users choice in shared preferences, I accomplished this with background color by using the following:</p>
  
  <pre><code> &lt;ListPreference 
           android:summary="@string/main_bg_list_pref_summary"
           android:title="@string/main_bg_list_pref_title" 
           android:key="main_view_bg_list_pref"
           android:entries="@array/color_names"
           android:entryValues="@array/color_values"
           android:defaultValue="white"/&gt;
  </code></pre>
  
  <p>The arrays look like this:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;string-array name="color_names"&gt;
          &lt;item name="red"&gt;Red&lt;/item&gt;
          &lt;item name="green"&gt;Green&lt;/item&gt;
          &lt;item name="blue"&gt;Blue&lt;/item&gt;
          &lt;item name="grey"&gt;Grey&lt;/item&gt;
          &lt;item name="white"&gt;White&lt;/item&gt;
          &lt;item name="black"&gt;Black&lt;/item&gt;
      &lt;/string-array&gt;
      &lt;string-array name="color_values"&gt;
          &lt;item name="red"&gt;#990000&lt;/item&gt;
          &lt;item name="green"&gt;#009900&lt;/item&gt;
          &lt;item name="blue"&gt;#000099&lt;/item&gt;
          &lt;item name="grey"&gt;#CCCCCC&lt;/item&gt;
          &lt;item name="white"&gt;#FFFFFF&lt;/item&gt;
          &lt;item name="black"&gt;#000000&lt;/item&gt;
      &lt;/string-array&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>and on my activity page, I have the following code:</p>
  
  <pre><code>View linearLayout;
  SharedPreferences prefs; 
  prefs = PreferenceManager.getDefaultSharedPreferences(this);
  prefs.registerOnSharedPreferenceChangeListener(this);  
  
          linearLayout= findViewById(R.id.main_layout);
          String bg = prefs.getString("main_view_bg_list_pref", "#FFFFFF");
  
          linearLayout.setBackgroundColor(Color.parseColor(bg));
  </code></pre>
  
  <p>My layout file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" 
      android:background="#FFF"
      android:gravity="center"
      android:id="@+id/main_layout"&gt;"
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="@string/mainscreen_title" 
          android:textSize="25sp"
          android:textColor="#000"
          android:gravity="center"/&gt;
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="@string/main_prompt"
          android:textSize="15sp"
          android:layout_marginTop="20dp"
          android:gravity="center"
          android:textColor="#000"
      /&gt;
  
      &lt;Button
          android:id="@+id/post_review"
          android:layout_width="200dp"
          android:layout_height="60dp"
          android:layout_marginTop="20dp"
          android:text="@string/post_review_txt"
          android:textSize="15sp"
          android:textColor="#FFFFFF"
          android:background="@drawable/buttonshape"
           /&gt;
  
      &lt;Button
          android:id="@+id/view_reviews"
          android:layout_width="200dp"
          android:layout_height="60dp"
          android:layout_marginTop="20dp"
          android:text="@string/view_review_txt"
          android:textSize="15sp"
          android:textColor="#FFFFFF"
          android:background="@drawable/buttonshape"
           /&gt;
  
      &lt;Button
          android:id="@+id/add_category"
          android:layout_width="200dp"
          android:layout_height="60dp"
          android:layout_marginTop="20dp"
          android:text="@string/add_category_txt"
          android:textSize="15sp"
          android:textColor="#FFFFFF"
          android:background="@drawable/buttonshape"
           /&gt;
  
      &lt;Button
          android:id="@+id/view_remote_categories"
          android:layout_width="200dp"
          android:layout_height="60dp"
          android:layout_marginTop="20dp"
          android:text="@string/view_remote_categories_txt"
          android:textSize="15sp"
          android:textColor="#FFFFFF"
          android:background="@drawable/buttonshape"
           /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I am trying to do this similarly with font size for a particular TextView, but because there is no method available like setting the background color,I am unsure how this works, so far I have this:</p>
  
  <pre><code> &lt;ListPreference 
           android:summary="@string/main_font_summary"
           android:title="@string/main_font_title" 
           android:key="main_font_pref"
           android:entries="@array/font_names"
           android:entryValues="@array/font_values"
           android:defaultValue="15sp"/&gt;
  </code></pre>
  
  <p>arrays:</p>
  
  <pre><code>   &lt;string-array name="font_names"&gt;
          &lt;item name="large"&gt;Large Font&lt;/item&gt;
          &lt;item name="medium"&gt;Medium Font&lt;/item&gt;
          &lt;item name="small"&gt;Small Font&lt;/item&gt;
      &lt;/string-array&gt;
      &lt;string-array name="font_values"&gt;
          &lt;item name="large"&gt;20sp&lt;/item&gt;
          &lt;item name="medium"&gt;15sp&lt;/item&gt;
          &lt;item name="small"&gt;10sp&lt;/item&gt;
      &lt;/string-array&gt;
  </code></pre>
  
  <p>Is there some way to target a textview ID somehow and change this through the prefs?</p>