Changing color of Paint in android,using SharedPreferences
<p>I have two different activities. One's view contains <code>RadioButton</code>s that give the user choice to select color, then when the user draws on the <code>Canvas</code>,the color selected in the options activity is used to draw.
Here's the code for the Options <code>Activity</code>:</p>

<pre><code>            RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radiogroup);
            int checkedRadioButton = radioGroup.getCheckedRadioButtonId();

            String radioButtonSelected = "";
            switch (checkedRadioButton) {
              case R.id.CheckRed : radioButtonSelected = "Red";
                                              break;
              case R.id.CheckBlue : radioButtonSelected = "Blue";
                                          break;
              case R.id.CheckWhite : radioButtonSelected = "White";
                                          break;
            }
            SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
            Editor prefsEditor = appSharedPrefs.edit();
            prefsEditor.putString("setColor", radioButtonSelected);
            prefsEditor.commit();
</code></pre>

<p>Here's the xml for this <code>Activity</code>:</p>

<pre><code>    &lt;RadioGroup 
        android:id="@+id/radiogroup"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="vertical" &gt;


    &lt;RadioButton 
        android:id="@+id/CheckWhite"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="White" /&gt;

    &lt;RadioButton 
        android:id="@+id/CheckRed" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:text="Red" /&gt;

    &lt;RadioButton
        android:id="@+id/CheckBlue" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Blue" /&gt;

&lt;/RadioGroup&gt;
</code></pre>

<p>Notice that <code>CheckWhite</code> has <code>android:checked="true"</code>. I want that to be true for whichever color the user selects later on.</p>

<p>Here's the code for the <code>Activity</code> that does the drawing:</p>

<pre><code>        SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
        drawColor = appSharedPrefs.getString("setColor", "White");
        if(drawColor.equals("White"))
            intColor = 1;
        if(drawColor.equals("Red"))
            intColor = 2;
        if(drawColor.equals("Blue"))
            intColor = 3;


        mPaint = new Paint();
        if(intColor == 1)
            mPaint.setColor(Color.WHITE);
        if(intColor == 2)
            mPaint.setColor(Color.RED);
        if(intColor == 3)
            mPaint.setColor(Color.BLUE);
</code></pre>

<p>Unfortunately,the color doesn't change. Kindly help!</p>
