title: Android EditText. Text visibility in readonly mode
body: <p>When I set EditText in readonly mode, the Font color and its background become almost unable to read. Pls, see the pic</p>
  
  <p><a href="https://i.stack.imgur.com/pF93C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pF93C.png" alt="enter image description here"></a></p>
  
  <h1>Question: how to keep its appearance the same in ReadOnly mode from code?</h1>
  
  <p>UPDATE: Thank you for your help.. I published my solution.. I forgot to mention "FROM CODE"</p>
  
  <pre><code>EditText ed = new EditText(this);
  ed.setId(myId);
  ed.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 0));
  ed.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
  ed.setText(myText);
  
  int[][] states = new int[][] { new int[] { android.R.attr.state_enabled}, new int[] {-android.R.attr.state_enabled} };
  int[] colors = new int[] { Color.BLACK, Color.BLACK };
  ColorStateList myList = new ColorStateList(states, colors);
  ed.setTextColor(myList);
  ed.setEnabled(false);
  </code></pre>