Remember the ColorStateList xml? by which you specify to a view use this color if you are in this state:
Something like:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:color="hex_color"
android:state_pressed=["true" | "false"]
android:state_focused=["true" | "false"]
How do I enforce by code: “Hey view! You are now in this state! Display accordingly!!” ??
My problem is with a listview. I want a child to appear as clicked/selected, and neither of this lines seem to do the work:
m_listView.getChildAt(0).requestFocus();
m_listView.getChildAt(0).setPressed(true);
Forgot about this..
Solution was:
m_ItemsListView.setItemChecked(0, true);