Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread Mark Murphy
On Thu, Dec 6, 2012 at 11:13 PM, TreKing treking...@gmail.com wrote: I'm trying to display some text that I get from various web sources in some TextViews. The data is out of my control and may contain links to other sites. The links may be raw or anchored. By this I mean: Raw link is like

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread TreKing
On Fri, Dec 7, 2012 at 6:25 AM, Mark Murphy mmur...@commonsware.com wrote: Use Html.fromHtml() on your input string before passing it to the TextView. Thanks Mark, but that's pretty much what I'm doing, sorry if that wasn't clear. So, as a simple example, if I have the following html string

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread Mark Murphy
On Fri, Dec 7, 2012 at 11:14 AM, TreKing treking...@gmail.com wrote: Thanks Mark, but that's pretty much what I'm doing, sorry if that wasn't clear. So, as a simple example, if I have the following html string and set it using fromHtml, only one link works: String test =

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread TreKing
On Fri, Dec 7, 2012 at 10:32 AM, Mark Murphy mmur...@commonsware.comwrote: You may need to scan the HTML and either de-tag the a links or add the a tags to the plain links, at which point you should no longer need autoLink, setMovementMethod(), etc. Ugh. It might come to that ... but

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread Piren
Or alternatively allow it to figure out all the link as usual and then re-link them into ClickableSpan On Friday, December 7, 2012 12:13:23 PM UTC-5, TreKing wrote: On Fri, Dec 7, 2012 at 10:32 AM, Mark Murphy mmu...@commonsware.comjavascript: wrote: You may need to scan the HTML and

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread TreKing
On Fri, Dec 7, 2012 at 12:10 PM, Piren gpi...@gmail.com wrote: Or alternatively allow it to figure out all the link as usual and then re-link them into ClickableSpan Could you clarify what you mean by re-link them into ClickableSpan? Thanks.

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread Piren
let the autolink do its job, then get the editable text and iterate through all the spans, then re-assign all the clickableSpans, then let the text have the default LinkMovementMethod. On Friday, December 7, 2012 1:45:05 PM UTC-5, TreKing wrote: On Fri, Dec 7, 2012 at 12:10 PM, Piren

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread TreKing
On Fri, Dec 7, 2012 at 1:08 PM, Piren gpi...@gmail.com wrote: let the autolink do its job, then get the editable text and iterate through all the spans, then re-assign all the clickableSpans, then let the text have the default LinkMovementMethod. OK - I think you're describing what pskink

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread skink
TreKing wrote: OK - I think you're describing what pskink wrote out in code, and that works. Still blows my mind this doesn't just work, see sources of Linkify. they are removing all UrlSpans before adding new ones pskink -- You received this message because you are subscribed to the

Re: [android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-07 Thread Piren
hehe yeah, pretty much... after i replied i noticed he wrote something very similar. Well... i did write my original answer before him :-P On Friday, December 7, 2012 2:34:18 PM UTC-5, TreKing wrote: On Fri, Dec 7, 2012 at 1:08 PM, Piren gpi...@gmail.com javascript:wrote: let the autolink

[android-developers] Can't Use Raw Links and Anchor Links in One TextView?

2012-12-06 Thread TreKing
I'm trying to display some text that I get from various web sources in some TextViews. The data is out of my control and may contain links to other sites. The links may be raw or anchored. By this I mean: Raw link is like *http://www.google.com* Anchored link is like *a