Meaningless Drivel is fun!*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Onclick listener for TextView" Watch "Onclick listener for TextView" New topic
Author

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
Greenhorn

Joined: Jun 06, 2013
Posts: 3
You should implement the OnItemSelectedListener interface and the onItemSelected() event handler. Check the Android Developers site: http://developer.android.com/guide/topics/ui/controls/spinner.html
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
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

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




Swastik
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Onclick listener for TextView