Questions tagged [clickablespan]

38 questions
248
votes
20 answers

How to set the part of the text view is clickable

I have the text "Android is a Software stack". In this text i want to set the "stack" text is clickable. in the sense if you click on that it will redirected to a new activity(not in the browser). I tried but i am not getting.
naresh
  • 9,682
  • 25
  • 77
  • 123
10
votes
5 answers

How to set multiple click event for the single textview?

I have a textview as like the following: txtByRegistering.setText("By Registering you agree to terms and condition and privacy policy"); It is just a big text. So, I used marquee to scroll the text horizontally. that works fine. My Question is, How…
Rethinavel
  • 3,721
  • 5
  • 26
  • 48
7
votes
1 answer

Bold ClickableSpan on touch

I have a TextView in which every word is a ClickableSpan (actually a custom subclass of ClickableSpan). When a word is touched, it should be shown in bold font style. If I set textIsSelectable(false) on the TextView, it works just fine. The word is…
Matt Robertson
  • 2,283
  • 5
  • 23
  • 51
6
votes
2 answers

Linkify.addLinks with Span not working

I have textview with autoLink, but whenever i add custom span (ClickableSpan) to textview its auto link to web url and mobile number is not working. is there any easy way to solve this issue. Style is applied but click is not working.
Bincy Baby
  • 2,409
  • 4
  • 27
  • 53
6
votes
1 answer

ClickableSpan - How to remove color on text when added?

I've used ClickableSpan on a TextView. Upon adding the span, the color of text where it has been applied was changed too. Checking SO questions, what I've seen are changed color after it was clicked. In my case, the color is already different upon…
sticky
  • 325
  • 1
  • 3
  • 15
5
votes
1 answer

Handling click for a ClickableSpan with selectable text requires double click

I have a TextView in which every word is a ClickableSpan. When clicked, the word become bold and the dictionary definition of the word is shown in another TextView. The app works correctly until I make the text in the TextView selectable. When the…
Matt Robertson
  • 2,283
  • 5
  • 23
  • 51
5
votes
1 answer

How to set multiple on click listeners on different words of textview?

Just how the facebook app does it. Multiple clickable texts in one textView. I tried the FlowLayout and multiple texviews but still the texview shifts to another line when the text exceeds the width.
Sourav Chandra
  • 785
  • 11
  • 21
3
votes
1 answer

NativeScript - Clickable Span not supported

Even though Clickable Span is not supported in {N}, but is there any workaround for this? I have read the following thread but still don't really know how to implement on NativeScript-Vue, may anyone help, please? Feature request: ClickableSpan…
Felicia
  • 119
  • 5
3
votes
1 answer

ClickableSpan in the EditText to the end of text calls click() to the end of line

I have an EditText and the TextWatcher, in which I check for patterns to determine where to create ClickableSpans. private void checkSpans(){ Matcher matcher = Pattern.compile("(^|[ \\t\\n])#\\w+").matcher(text); while (matcher.find()) { …
Prokky
  • 735
  • 6
  • 18
3
votes
1 answer

Android Handle/Override/Interrupt Intent from the same Activity that fired it

I have an android application that has to parse fairly large amounts of HTML and place it inside one or more TextViews. So any one of these given text views might contain one more html link. These links are created dynamically and embedded in the…
pat8719
  • 1,580
  • 1
  • 25
  • 45
2
votes
3 answers

How to make ClickableSpan links in MaterialAlertDialogBuilder clickable?

I have a SpannableStringBuilder object with a ClickableSpan link like this, SpannableStringBuilder ssb = new SpannableStringBuilder("Hi StackOverflow!"); ClickableSpan clickableSpan = new ClickableSpan() { @Override public void…
2
votes
0 answers

How Do I Block a CheckBox Pressed State When User Clicks a ClickableSpan Inside Of It?

I had a need to have a CheckBox that contained an integrated clickable area to bring up another screen in the app. This solution works wonderfully: CheckBox checkBox = (CheckBox) findViewById(R.id.my_check_box); ClickableSpan clickableSpan = new…
CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253
2
votes
2 answers

How to create clickable label Like Facebook in ios?

I am developing a social app in which I need show post and sharing etc. I also need to show tag friend. When post is show on list UI is also similar to Facebook post. Please check below screen shot. As you can see Clicking Post title is as…
Crazy Developer
  • 3,318
  • 3
  • 23
  • 58
2
votes
0 answers

Is there a way to make a ClickableSpan background round?

Is there a way to make the background of the ClickableSpan class rounded instead of the default rectangle? This is my base custom ClickableSpan class: public class TagSpan extends ClickableSpan { @Override public void onClick(View widget) { …
Alex
  • 21
  • 3
2
votes
2 answers

ClickableSpan avoid touch propagation to parent view

I have a SpannableString set as the text of my TextView which is inside another view that has a click handler. I've got ClickableSpans inside my text which are, you are right, clickable. My problem is that I need touch events to be captured in case…
1
2 3