title: Change text color of check box in a list view
body: <p>So I have a list of checkboxes in a list array populated with various text and a custom checkmark that effectively shows when I click the specific item. However, I can't seem to change the text color of the text in the item that is checked. I want to change it to the same color as the checkmark. When I do click on the item and when the text color is set to the textColor code below, the text turns pink! which is not the color I want. It seems to be a default color. My question is then how do I change the textColor of the particular checkbox that I have checked that is embedded in a listview? I have searched on this website and others but I couldn't find an answer that could help me. </p>
  
  <p>text color</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:state_checked="true" android:textColor="@color/purple_color" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>and purple checkmark:</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@android:color/transparent" android:state_checked="false"/&gt;
      &lt;item android:drawable="@drawable/ic_check_black_24dp" android:state_checked="true"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>and list view in the activity: </p>
  
  <pre><code>&lt;ListView
              android:id="@+id/myList"
              android:paddingTop="12dp"
              android:layout_marginLeft="44dp"
              android:layout_marginRight="44dp"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content" /&gt;
  </code></pre>
  
  <p>and the individual list item:</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"&gt;
  
      &lt;CheckBox
          android:id="@+id/orientation_type"
          android:layout_width="fill_parent"
          android:layout_height="44dp"
          android:gravity="left|center_vertical"
          android:textColor="@drawable/check_box_text_color_purple"
          android:textSize="17dp"
          android:layoutDirection="rtl"
          android:button="@drawable/check_purple" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and the array adapter:</p>
  
  <pre><code>public class orientation_adapter extends ArrayAdapter&lt;orientation_item&gt; {
  
      private Context mContext;
      int mResource;
  
      public orientation_adapter(@NonNull Context context, int resource, @NonNull ArrayList&lt;orientation_item&gt; objects) {
          super(context, resource, objects);
          this.mContext = context;
          this.mResource = resource;
      }
  
      @NonNull
      @Override
      public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
  
          String orientation = getItem(position).getOrientation();
  
          gender_item user_orientation = new gender_item(orientation);
  
          LayoutInflater inflator = LayoutInflater.from(mContext);
          convertView = inflator.inflate(mResource, parent, false);
  
          //TextView orientation_type = (TextView) convertView.findViewById(R.id.orientation_type);
          CheckBox orientation_type = (CheckBox) convertView.findViewById(R.id.orientation_type);
  
          orientation_type.setText(orientation);
  
          return convertView;
  
      }
  
  }
  </code></pre>
  
  <p>and the main activity:</p>
  
  <pre><code>ArrayList&lt;orientation_item&gt; list = new ArrayList&lt;&gt;();
  
   //items created and added here
  
   adapter = new orientation_adapter(ChooseOrientation.this, R.layout.orientation_unit, list);
  
          myList.setAdapter(adapter);
  </code></pre>