title: How to save color to SharedPreferences Android
body: <p>I am trying to save color to <code>SharedPreferences</code> using</p>
  
  <pre><code>public static void saveChannelImageColor(int color) {
      saveInt(CHANNEL_ID1, color);
  }
  
  public static int getChannelImageColor() {
      return getInt(CHANNEL_ID1, 0xff0000ff);
  }
  </code></pre>
  
  <p>But when i am trying to get the color it is giving error </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.lang.String cannot be cast to
    java.lang.Integer at
    android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:239)</p>
  </blockquote>