Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Onclick listener for TextView

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help!!!
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic