Questions tagged [urlspan]

12 questions
11
votes
2 answers

How to make links among other text focusable for accessibility

I have a CheckedTextBox whose text is made up of two SpannableStrings, one of which is a URLSpan. My question is, how do I make so that a user can move the accessibility focus through each span, eventually focusing on the URLspan itself?…
VIN
  • 6,385
  • 7
  • 38
  • 77
7
votes
3 answers

Handle clicks on TextView's links while using Linkify for finding and setting the links inside the text

i have a TextView filled with text which i get from a server. I'm using Linkify for handling all the link searching and for setting a URLSpan where needed throughout its addLinks method. The problem is that the default behavior when clicking a link…
Shirane85
  • 2,255
  • 1
  • 26
  • 38
4
votes
1 answer

How to use autoLink in textView and custom URLSpan both together?

I have a textView like this: And a Spannable string like…
user3473590
3
votes
0 answers

Custom URLSpan don't trigger onClick event, using kotlin

I have this layout: And this code to implement and set my…
Raymond Arteaga
  • 4,355
  • 19
  • 35
3
votes
3 answers

How to clear URLSpan clicking effect?

Background I wanted to use some URLSpan inside a textView, so I've used something like: final Spanned spanned=Html.fromHtml(getString(R.string.test)); msgTextView.setText(spanned); The problem It works, but when clicking an item, it stays clicked.…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
2
votes
2 answers

android custom URLSpan not working

The problem is to handle my own action on click on URL span. I wrote custom URLSpan but it doesn't work. This is my custom URLSpan: public class CustomURLSpan extends android.text.style.URLSpan { private Command mClickAction; public…
Alexander Tumanin
  • 1,638
  • 2
  • 23
  • 37
1
vote
1 answer

Custom Urlspan doesn't react on click

I have made a custom URL span to use the chrome custom tab to open a link. The links are getting displayed correctly, I use the Html.fromHtml() function. In the activity I use this for the TextView: content_txt_view =…
0
votes
1 answer

Dynamically replace url's with custom text hyperlink url in Android TextView

Let’s say you have the string: "https://google.com to go to google. https://amazon.com to go to Amazon." In a TextView, how would you replace the url’s with a link that shows “Click here” (or “Haz clic aquí” in spanish) and would take you to the…
0
votes
1 answer

Open link on a text set to UILabel as attributed string. Attributed string is read from a json response

I am reading this json response in my tableview cell. I have set this to a UILabel and managed to show this as attributed sting to my label. My view is showing the text inside the tags as link but the click on link does not work. What i want is to…
Yogesh Tandel
  • 1,738
  • 1
  • 19
  • 25
0
votes
1 answer

Urlspan can not trigger Click on Textview

I have spanableString like below TextView contentNews = findViewById(R.id.text) ......... ......... //article.getP() is HTML string ......... CharSequence sequence = Html.fromHtml(article.getP(), this, null); SpannableString spannableString = new…
Nanda Z
  • 1,604
  • 4
  • 15
  • 37
0
votes
1 answer

open link with chrome custom link

i have implemented a Custom URL Span to open link with the chrome custom tab instead of default browser. The on click method of it is started, but I dont know how to launch the chrome custom launcher. it looks this way: public class…
0
votes
1 answer

Android,start Activity by urlspan with extras?

As mentioned here,we can start Activity by Intent that is created with specific url,when Activity has desired intent filter.So we can start Activity by setting a URLSpan for SpanableString that is set as text for text view,like this: ss.setSpan(new…
hasanghaforian
  • 13,858
  • 11
  • 76
  • 167