File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Onclick listener for TextView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Onclick listener for TextView" Watch "Onclick listener for TextView" New topic

Onclick listener for TextView

Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 159
I have written code for loading the spinner and creating few textview dynamically. And onlclick of one textview i need to navigate to another activity.

Problem here is onclick of the spinner, onclick method is called(with have been set to the awb_textView. I need this to onClick method to be called only
when the awb_textView textview is clicked on the spinner.

Thanks in advance!
Borja Torre

Joined: Jun 06, 2013
Posts: 3
You should implement the OnItemSelectedListener interface and the onItemSelected() event handler. Check the Android Developers site:
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 159
Thanks for the reply. But here i didn't any action listener for spinner, i implemented only for TextView. But the here is, i need to move to next page, when i click on the textview, but here even on clicking on spinner, its taking to next page.
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 159
Any help!!!
Swastik Dey

Joined: Jan 08, 2009
Posts: 1480

Instead of onClickListener try onTouchListener on TextView. You can also use android.text.SpannableString class to look the textview like a hyper link. An example code

I agree. Here's the link:
subject: Onclick listener for TextView