Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old November 13th, 2010, 10:33 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 12
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default onClick in TextView doesnt work

Hello,

I want a Menu with Textview to click it and react.

There is my TextView:
Code:
<TextView
                android:layout_width="fill_parent"
                android:layout_height="40px"
                android:text="MyLink"
                android:onClick="onClickMyLink"
                android:textColor="@color/white"
                android:padding="8px"
                style="@style/home_menu"/>
There is my listener method:
Code:
public void onClickMyLink(final View sfNormal) {
But If I click on the Text, it is not call my method.
The same method is working with a <button> tag
but not with my TextView.

Anybody an idea?

greets
Markus

Advertisements
Markus Taubek is offline  
Reply With Quote
sponsored links
Old November 13th, 2010, 11:30 AM   #2 (permalink)
Junior Member
 
Join Date: Nov 2010
Posts: 15
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

ClickableSpan | Android Developers
droidotheplains is offline  
Reply With Quote
Old November 13th, 2010, 05:08 PM   #3 (permalink)
Junior Member
 
Join Date: Oct 2010
Posts: 17
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 4 Times in 4 Posts
Default

two things:

1. Clickable views should come with an ID to identify them

2. It's not clickable without android:clickable="true"
aguywithathing is offline  
Last edited by aguywithathing; November 13th, 2010 at 05:11 PM.
Reply With Quote
Old November 14th, 2010, 02:21 AM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 12
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by aguywithathing View Post
two things:

1. Clickable views should come with an ID to identify them

2. It's not clickable without android:clickable="true"
Thanks.. android:clickable is the attribut what I searched.

greets
Markus
Markus Taubek is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:30 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.