am 5370dc8f: am 2a9de021: Clean up and extend the linkify sample.

* commit '5370dc8f0dc20a46302f823af38cb48d08de1c45':
  Clean up and extend the linkify sample.
This commit is contained in:
Dianne Hackborn
2012-01-20 15:52:04 -08:00
committed by Android Git Automerger
3 changed files with 62 additions and 43 deletions

View File

@@ -59,7 +59,7 @@ public class Link extends Activity {
TextView t3 = (TextView) findViewById(R.id.text3);
t3.setText(
Html.fromHtml(
"<b>text3:</b> Text with a " +
"<b>text3: Constructed from HTML programmatically.</b> Text with a " +
"<a href=\"http://www.google.com\">link</a> " +
"created in the Java source code using HTML."));
t3.setMovementMethod(LinkMovementMethod.getInstance());
@@ -70,11 +70,11 @@ public class Link extends Activity {
// hardcoded value.
SpannableString ss = new SpannableString(
"text4: Click here to dial the phone.");
"text4: Manually created spans. Click here to dial the phone.");
ss.setSpan(new StyleSpan(Typeface.BOLD), 0, 6,
ss.setSpan(new StyleSpan(Typeface.BOLD), 0, 30,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss.setSpan(new URLSpan("tel:4155551212"), 13, 17,
ss.setSpan(new URLSpan("tel:4155551212"), 31+6, 31+10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView t4 = (TextView) findViewById(R.id.text4);