Skip to content Skip to sidebar Skip to footer

Onclick And Ontouch On Textview?

I want to do something when the user touch (or click) on a TextView but I can't seems to make it work. I simply place a TextView in Layout and I tryied to set an onclick listener.

Solution 1:

You forgot to call show() on the Toast and so it was never displayed; its a common mistake :-) Change code to:

Toast.makeText(getApplicationContext(),"Text Touch",Toast.LENGTH_SHORT).show();

Post a Comment for "Onclick And Ontouch On Textview?"