StateListDrawable drawable =
new
StateListDrawable();
drawable.addState(
new
int
[]{-android.R.attr.state_focused, -android.R.attr.state_selected, -android.R.attr.state_pressed},
getResources().getDrawable(R.drawable.contact));
drawable.addState(
new
int
[]{-android.R.attr.state_focused, android.R.attr.state_selected, -android.R.attr.state_pressed},
getResources().getDrawable(R.drawable.contact_sel));
drawable.addState(
new
int
[]{android.R.attr.state_focused,-android.R.attr.state_selected, -android.R.attr.state_pressed},
getResources().getDrawable(R.drawable.contact_sel));
drawable.addState(
new
int
[]{android.R.attr.state_focused,android.R.attr.state_selected, -android.R.attr.state_pressed},
getResources().getDrawable(R.drawable.contact_sel));
drawable.addState(
new
int
[]{android.R.attr.state_selected, android.R.attr.state_pressed},
getResources().getDrawable(R.drawable.contact_sel));
drawable.addState(
new
int
[]{android.R.attr.state_pressed},
getResources().getDrawable(R.drawable.contact_sel));
TextView textView = (TextView) findViewById(R.id.TextView_title);
textView.setCompoundDrawablesWithIntrinsicBounds(
null
, drawable,
null
,
null
);