text not linkified

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

text not linkified

Postby purvi » Wed Oct 21, 2009 10:37 pm

Hello,

I m rendering a TextView from Code using
TextView tv = new TextView(this);

I want the text content of TextView to be Linkify. To set the text
links I tried using

1.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  Linkify.addLinks(tvMessage, Linkify.ALL); // where tvMessage is my TextView
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

and
2.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. tvMessage.setTextAppearance(c, R.style.textlink); // where c is Context and R.style.textlink is
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <resources>
  3.  
  4. <style name="textlink"><item name="android:autoLink">all</item>
  5.  
  6. </style>
  7.  
  8. </resources>
  9.  
  10.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

Neither of above two code works for me. I am not able to get automatic
links in the text.
Can anyone please help me to set the links for text content? Can
anyone tell me what is the right way to set a linkify textview from
code?

Thanks.
Regards,
Purvi
purvi
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Oct 19, 2009 2:52 pm

Top

Postby wiederke » Thu Oct 22, 2009 12:12 pm

Hi,

I use android:autoLink="web" as attribute of the TextView tag and it works fine.


Bye,

Torsten
wiederke
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Mon Mar 02, 2009 6:46 pm
Location: Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests