I have a table row and I tried many things to change its color when it’s focused, but it never changes color when focused. Is there any way to do this? I tried this also which changed color on click but only when its’ focused:
r.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent arg1) {
if(arg0.isFocused())
{
arg0.setBackgroundColor(Color.BLUE);
//arg0.isFocused();
}
return false;
}});
You need to set the background color of your row to a state list drawable (that handles select, pressed, active, non-active).
try these links too, for ur problem
http://www.gersic.com/blog.php?id=56
http://developer.android.com/guide/topics/ui/themes.html