Android Linkify tanto web como @menciones en el mismo TextView
Ok, entonces pregunté esto ayer:
AutoLink @menciones en un cliente de twitter
Tengo mis @menciones vinculadas correctamente. Pero para que funcione, tuve que usar android: autoLink = "web" en mi xml para TextView. Entonces ahora obtengo enlaces a @menciones pero ya no enlaza URLs. Intenté hacer dos llamadas separadas de Linkify.addLinks () como esta:
mentionFilter = new TransformFilter() {
public final String transformUrl(final Matcher match, String url) {
return match.group(1);
}
};
// Match @mentions and capture just the username portion of the text.
//pattern = Pattern.compile("@([A-Za-z0-9_-]+)");
pattern = Pattern.compile("(@[a-zA-Z0-9_]+)");
scheme = "http://twitter.com/";
tweetTxt = (TextView) v.findViewById(R.id.tweetTxt);
Linkify.addLinks(tweetTxt, pattern, scheme, null, mentionFilter);
Linkify.addLinks(tweetTxt, Linkify.WEB_URLS);
Pero el que se llama último es el que se aplica. ¿Alguien puede decirme cómo puedo hacer que vincule las @menciones y aún así vincular automáticamente las URL?
Editado para aclarar un poco más del código.