How to make linkable TextView with Linkify

by Marco Rocco » Thu, 14 Oct 2010 01:32:18 GMT


Sponsored Links
 I would make a textview linkable, and i have tried with this code:

[...]
TextView textview;
for (int i = 0; i < 5; i++) {
        textview = new TextView(this);
        htmlString = "<a href=' http://www.google.com '>Try Me</a>";
        textview.setText(Html.fromHtml(htmlString));
        Linkify.addLinks(textview, Linkify.WEB_URLS);
        lx.addView(textview, layoutParams);
}
[...]

but when i click on a textview nothing happens!

Anyone can help me?

--



How to make linkable TextView with Linkify

by Dimitris » Thu, 14 Oct 2010 01:39:46 GMT


 I think you might have to call setMovementMethod() on your textview.

See:

 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/text/Link.html 




--


Sponsored Links


Other Threads

1. Android Devices by Country

AdMob's mobile metrics report has data about the number of Android
Devices by Country:

http://metrics.admob.com/wp-content/uploads/2010/06/May-2010-AdMob-Mobile-Metrics-Highlights.pdf

Interesting stuff on page 21:

Android Devices by country:

United States
66%
China
13%
United Kingdom
4%
France
2%
Japan
2%
Germany
2%
Republic of Korea
1%
Spain
1%
Canada
1%
Sweden
1%

It is mentioned here often that the Android Market needs to offer paid
apps to more countries. No disagreement on my part. Given the above,
though, if Google suddenly turned on 20 more countries tommorrow, I
wouldn't expect earnings to double or triple overnight. Maybe you
could expect them to increase by 5-10%. Of course, if you are not
allowed to *sell* apps from your country, changing that fact would
make a huge difference for you.

I have an app that I believe should be just as valuable to people in
Canada as to those in the US. Yet only 1-2% of purchases have come
from Canada. When I look at this chart, though, it doesn't seem
terribly out of line given that there are 66 times as many Android
users in the US vs Canada.

Some apps are pretty universal. In my case, to attract more countries,
I'd need to add relevant content and localized strings. Seeing this
breakdown may change how I prioritize that effort and expense.

How are other people sale's in the US vs non US?

Any thoughts?

Nathan

--

2. Android TTS sound braking

HI,

I have developed TTS based application, When playing it sound, if any other
notification triggered, Then TTS playing with sound braking.( Ex: if SMS
received TTS sound brake)
What are condition which can occur such a issue?

Thank You.

-- 

3. get the genre name with most songs from the music library

4. Gradient, Shadow and MaskFilter on a TextView

5. Ant Emma and JUnit, integrating all three

6. Is there a Horizontal ListView?

7. How to get Temporary Mobile Subscriber Identity(TMSI) in Android