I am using Simple Listview to display Email addresses from Contact List. Its working fine. Now I want to change the color of text displaying email address on each row as I am displaying background for Listview.
Please give me your suggestions or any code. How can I change color?
This is the code:
<ListView
android:id="@+id/listSendEmailFinal"
android:layout_below="@+id/btnAddRecepients"
android:layout_width="fill_parent"
android:layout_height="250dip"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:background="@drawable/listview_border"
android:cacheColorHint="#00000000"
>
</ListView>
Where listview_border.xml is:
<stroke android:width="1dp" android:color="#83F52C" />
<padding android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="2dp" />
<corners android:radius="10dp" />
<solid android:color="#E6E6FA" />
And this the listview coding:
mainListView.setAdapter(new ArrayAdapter<String>(AddReceiverDialog.this,android.R.layout.simple_list_item_multiple_choice, lv_arr));
mainListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
It seems you are using Simple adapter not custom adapter.
In this case you can create a theme with text desired text color and apply that theme in manifest file to your ListActivity.
create a xml file in values folder and paste this code.
and use attach this theme with activity like