* commit '5370dc8f0dc20a46302f823af38cb48d08de1c45': Clean up and extend the linkify sample.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user