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;
}});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…