Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make text view clickable in android?

Tags:

android

is it possible in android to make text view clickable if yes then how ??and if not then what will be the way for make a label clickable??i want to implement a call activity using this

private void call() {      try {          Intent callIntent = new Intent(Intent.ACTION_CALL);          callIntent.setData(Uri.parse("tel:"+keywordxmlparsing.phone));          startActivity(callIntent);      } catch (ActivityNotFoundException activityException) {          Log.e("dialing-example", "Call failed", activityException);      }  } 

thanks for ur responses in advance...

like image 588
atul yadav Avatar asked Jun 03 '11 11:06

atul yadav


People also ask

How to set part of the Android textview as clickable?

This example demonstrates how do I set the part of the Android textView as clickable. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.

How to add onclicklisteners to textviews?

Just like Buttons and ImageViews we can add onClickListeners to TextViews by simply adding the attribute android:onClick="myMethod" to your TextView XML tag. <TextView android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:text= "@string/clickTextView" android:onClick= "myMethod" />

How to open a stack activity from a textview?

then use a link with custom scheme and host in the text of the TextView as (in String.xml): and "activate" the link with setMovementMethod () (in onCreate () for activities or onCreateView () for fragments): This will open the stack activity with a tap on the "stack" word.

Can you copy a text from a textview?

While using any social media app or like using Facebook you may have seen there is a particular type of TextView which you cannot copy like a caption that people write on their posts. You can select the message but there few texts which cannot select or copy. So here we are going to learn how to implement that feature. Attention reader!


1 Answers

textView.setOnClickListener(new View.OnClickListener()); 

Have you tried this?

like image 139
Egor Avatar answered Oct 07 '22 06:10

Egor