There is a TextView in every ListView Item which I am setting through custom adapter. The TextView XML is not in same file where a ListView XML has been written, I want that when any Item of ListView gets selected the font color of that particular item should change. I also tried this by defining the different states of TextView i.e selected, focused and pressed but that dose not solve my problem. Please suggest me some solutions for it. Here is snippet..
a listeview in one xml file for eg. file1.xml
<ListView
android:id="@+id/listView1"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:clickable="true" />
and a TextView in different xml.. i.e file2.xml
<TextView
android:id="@+id/rowListTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:text="@string/app_name"
android:textColor="@color/file3"
android:textSize="10sp"
android:textStyle="bold" />
file for text color attribute in res/color folder i.e file3.xml.
<item android:state_selected="true" android:color="@android:color/white"/>
<item android:state_focused="true" android:color="@android:color/white"/>
<item android:state_pressed="true" android:color="@android:color/white"/>
<item android:color="@android:color/black"/>