Questions tagged [clickablespan]
42 questions
289
votes
26 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 as clickable. So, if you click on that it will redirected to a new activity(not in the browser).
I tried but i am not getting a solution.

naresh
- 10,332
- 25
- 81
- 124
13
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,912
- 7
- 28
- 49
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,928
- 5
- 34
- 62
7
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
- 383
- 1
- 4
- 19
6
votes
3 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
- 3,941
- 5
- 36
- 62
5
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…

Amila Abeygunasekara
- 387
- 4
- 14
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,928
- 5
- 34
- 62
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
- 843
- 12
- 21
4
votes
0 answers
Click action for clickable span text in Accessibility mode Android
I have a text which has two clickable span text and the click action for these links working in normal mode. But in accessibility mode the textview gets the focus and click action on the clickable span text is not working.
Text used is given below…

Ranjith
- 343
- 1
- 4
- 17
4
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
- 815
- 7
- 19
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
- 6
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,700
- 1
- 26
- 47
2
votes
0 answers
How to override link click in TextView to add an action
There is text with HTML tags. Following instructions from other answers, I formatted the text with HtmlCompat and added ClickableSpan and LinkMovementMethod. However, when I click on the link, I only follow it, and the additional actions that I…

Multiform
- 21
- 2
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
- 986,068
- 189
- 2,389
- 2,491
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,464
- 3
- 28
- 62