title: Android Studio, Shared Preferences Set Text Color
body: <p>At the moment I am trying to run this lines of code:</p>
  
  <pre><code>    @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setTitle("Tell me");
      setContentView(R.layout.activity_post);
      getSupportActionBar().setDisplayHomeAsUpEnabled(true)
      ;
      editText = (EditText) findViewById(R.id.editText1);
      textView = (TextView) findViewById(R.id.textView);
  
      SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
      String s = sharedPreferences.getString("font_list", "null");
      Typeface face = Typeface.createFromAsset(getAssets(), "fonts/" + s);
      editText.setTypeface(face);
  
      String s2 = sharedPreferences.getString("font_size", "8");
      editText.setTextSize(Float.parseFloat(s2));
  
      String s3 = sharedPreferences.getString("font_color", "#000");
      editText.setTextColor(Color.parseColor(s3));
  
  
  
     // File directory = new File(path);
    // directory.mkdirs();
  }
  </code></pre>
  
  <ul>
  <li>I am trying to set and store the colors that user choices to allow them to type in that color, but whenever I try to run the app or do anything within the app, it crashes because of the setTextColor function and the sharePreferences within the string for it.</li>
  </ul>
  
  <p>here is logcat image</p>
  
  <p><a href="https://i.stack.imgur.com/uQJO8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uQJO8.png" alt="enter image description here"></a></p>