Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android LinkMovementMethod in XML?

To enable Linkify behavior, I do this in code:

textView.setMovementMethod(LinkMovementMethod.getInstance());

Is there a way to set this in the layout xml for the textview?

like image 845
Ian Vink Avatar asked Aug 09 '10 01:08

Ian Vink


2 Answers

Use the "autoLink" property in the XML layout

like image 105
afollestad Avatar answered Nov 10 '22 04:11

afollestad


No, there is not. If you are using setMovementMethod(LinkMovementMethod.getInstance()); in so many places in your app that you want to avoid it, you should consider creating and using a custom class extending TextView which executes that method.

like image 9
Cristian Avatar answered Nov 10 '22 05:11

Cristian