Posts Tagged ‘TextView’
Android TextView making clickable url links
Friday, December 9th, 2011
So simple
View Code JAVA
1 2 3 4 5 6 7 8 9 10 11 12 | public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.help); TextView urlText; urlText = (TextView) findViewById(R.id.lblInfo4); String text = "Finally if you need more information then please pop over to <a href='http://support.depicus.com'>support.depicus.com</a> or " + "tweet me <a href='http://twitter.com/#!/depicus'>@depicus</a>."; urlText.setText(Html.fromHtml(text)); urlText.setMovementMethod(LinkMovementMethod.getInstance()); } |
And it should look like this







