jueves, 15 de enero de 2015

Android: Links inside texts


mEditText = (TextView) view.findViewById(R.id.toast_text);
            mEditText.setMovementMethod(LinkMovementMethod.getInstance());
            mEditText.setLinksClickable(true);
            Spanned text = Html.fromHtml("<html> Some text <a href=\"[url]\">Go</a> other text </html>");1
            mEditText.setText(text);
1 - If you change the text type from Spanned to String using toString(), it won't work.

No hay comentarios:

Publicar un comentario