i have a xml file with textview that contains a drawabletop image and customize listview that contains a header, i want when clicking the textview to show a toast, i don’t know why nothing is apprear
Java Activity
i have a xml file with textview that contains a drawabletop image and customize listview that contains a header, i want when clicking the textview to show a toast, i don’t know why nothing is apprear
Java Activity
tv_title = (TextView) findViewById(R.id.tv_myID);
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.myID:
Toast.makeText(getApplicationContext(), "HI", Toast.LENGTH_SHORT);
break;
default:
break;
}
}
put this
tv_title.setOnClickListener(this);after the this