Note that there are some explanatory texts on larger screens.

plurals
  1. POChange the font color of TextView when ListView Item gets selected
    primarykey
    data
    text
    <p>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..</p> <p>a listeview in one xml file for eg. file1.xml </p> <pre><code>&lt;ListView android:id="@+id/listView1" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="0.5" android:clickable="true" /&gt; </code></pre> <p>and a TextView in different xml.. i.e file2.xml</p> <pre><code>&lt;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" /&gt; </code></pre> <p>file for text color attribute in res/color folder i.e file3.xml.</p> <p> </p> <pre><code>&lt;item android:state_selected="true" android:color="@android:color/white"/&gt; &lt;item android:state_focused="true" android:color="@android:color/white"/&gt; &lt;item android:state_pressed="true" android:color="@android:color/white"/&gt; &lt;item android:color="@android:color/black"/&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload