TextView tv_title = new TextView(this);
tv_title.setClickable(true); //单击事件
tv_title.setFocusable(true); //获取焦点事件
tv_title.setFocusableInTouchMode(true); //触摸事件
//单击处理 tv_title.setOnClickListener(new OnClickListener()
{ public void onClick(View v) { } });
//获取焦点事件 (触摸)
tv_title.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { TextView tv_current_title = (TextView) v; // TODO Auto-generated method stub if (hasFocus == true) { //do something } else { //do something } } });