title: How to Change List View Text color
body: <p>In my application I want to change the list view text color. In this case I am using XML file for list view. Is it possible? If yes then give the example.</p>
  
  <p><em>gender.xml</em></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
   android:background="@drawable/topelg"
   &gt;
  
        &lt;ListView
          android:id="@+id/android:list"
          android:layout_marginTop="60dip"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:textColor="#000000"
  
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Egender.java</strong></p>
  
  <pre><code>package com.Elgifto;
  
  import android.app.ListActivity;
  import android.content.Intent;
  import android.graphics.Color;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.LinearLayout;
  import android.widget.LinearLayout.LayoutParams;
  import android.widget.ListView;
  
  public class Egender extends ListActivity{
      Button b1;
      ListView lv;
  
       /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.gender);
  
         // b1=(Button) findViewById(R.id.butt1);
          b1=new Button(this);
          b1.setText("Done");
  
         //b1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          lv=(ListView) findViewById(android.R.id.list);
  
          lv.addHeaderView(b1);  
  
          b1.setOnClickListener(new OnClickListener(){
                public void onClick(View v)
                {
                    // To send a result, simply call setResult() before your
                    // activity is finished.
  
                    finish();
                }
          });
  
          lv.setAdapter(new ArrayAdapter&amp;lt;String&amp;gt;(this,
                  android.R.layout.simple_list_item_single_choice, GENDER));
  
         lv.setBackgroundColor(Color.BLACK);
          lv.setItemsCanFocus(false);
          lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
          lv.setTextFilterEnabled(true);
  
      }
  
      private static final String[] GENDER = new String[] {
         "Male","Female"
      };
  }
  </code></pre>