androidlinkify

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?


Solution

  • 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.