Skip to content

Instantly share code, notes, and snippets.

@laaptu
Created July 22, 2014 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laaptu/1ae046ad494c23d40bab to your computer and use it in GitHub Desktop.
Save laaptu/1ae046ad494c23d40bab to your computer and use it in GitHub Desktop.
Dialog with linkable text, Dialog having clickable text
final TextView tv = new TextView(this);
final SpannableString s = new SpannableString(response);
Linkify.addLinks(s, Linkify.WEB_URLS);
tv.setText(s);
tv.setMovementMethod(LinkMovementMethod.getInstance());
AlertDialog dialog = new AlertDialog.Builder(this)
.setPositiveButton(android.R.string.ok, null)
.setView(tv).create();
dialog.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment