title: android Number picker text colour
body: <p>I want the values in number picker to be white.
  I did the folloowing code which made it default black.</p>
  
  <p>XML code: </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:background="@layout/gradient_blue"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="vertical"&gt;
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="10dp"
          android:textSize="25sp"
          android:textColor="#fff"
          android:textStyle="bold"
          android:text="Please select difficulty level"/&gt;
      &lt;View
          android:layout_width="match_parent"
          android:layout_height="1dp"
          android:background="@drawable/category_seperator"/&gt;
  
      &lt;LinearLayout
          android:padding="10dp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:orientation="horizontal"&gt;
  
          &lt;NumberPicker
              android:id="@+id/numberPicker1"
              android:layout_width="wrap_content"
              android:minWidth="100dp"
              android:layout_margin="10dp"
  
              android:layout_height="wrap_content"/&gt;
              &lt;!--#019687--&gt;
          &lt;Button
              android:background="#019687"
  
              android:id="@+id/setting_confirm"
              android:layout_width="wrap_content"
              android:layout_margin="10dp"
              android:layout_height="wrap_content"
              android:textSize="30sp"
              android:textColor="#fff"
              android:padding="15dp"
              android:text="OK"/&gt;
  
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Javacode:</p>
  
  <pre><code>    final Dialog d = new Dialog(context);
  d.requestWindowFeature(Window.FEATURE_NO_TITLE);
  
  d.setContentView(R.layout.dialog_settings);
  
  final NumberPicker n = (NumberPicker) d.findViewById(R.id.numberPicker1);
  
  String easy = Html.fromHtml("&lt;font color=\"white\"&gt;EASY&lt;/font&gt;").toString();
  String medium = Html.fromHtml("&lt;font color=\"white\"&gt;MEDIUM&lt;/font&gt;")+"";
  String hard = Html.fromHtml("&lt;font color=\"white\"&gt;HARD&lt;/font&gt;")+"";
  String tough = Html.fromHtml("&lt;font color=\"white\"&gt;TOUGH&lt;/font&gt;")+"";
  
  //        String[] a = {"EASY", "MEDIUM", "HARD", "TOUGH"};
  String [ ] a = {easy,medium,hard,tough};
  n.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
  n.setDisplayedValues(a);
  
  
  n.setMaxValue(3);
  n.setMinValue(0);
  n.setWrapSelectorWheel(true);
  
  d.show();
  </code></pre>
  
  <p>I tried to change colour using html to as shown in code.
  I also tried to change the colour using getChildAt and casting it to TextView which crashed the app.</p>
  
  <p><a href="https://i.stack.imgur.com/BCtk7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BCtk7.png" alt="Number picker text colour"></a></p>