Android html5 打电话、发短信、发邮箱等

整理自: 
http://blog.csdn.net/nvzizhou/article/details/49024823 
http://blog.csdn.net/id19870510/article/details/50378990

TextView tv_html = (TextView) findViewById(R.id.tv_html);
String str ="Html文本";
tv_html.setText(Html.fromHtml(str));
tv_html.setMovementMethod(LinkMovementMethod.getInstance());

1. 打电话

例:

<a href="tel:10086">10086</a>

使用wtai协议进行拨打电话

<a href="wtai://wp/mc;10086">10086</a>

2. 发送短信

例:

//给 10086 发短信:
<a href="sms:10086">发送信息</a>

//给 10086 发送内容为"cxye"的短信:
<a href="sms:10086?body=cxye">发送信息</a>

//给 10086 和 10010 发送内容为"cxye"的短信:
<a href="sms:10086,10010?body=cxye">发送信息</a>

3. Mail 发送邮件

例:

//给[email protected]发送邮件:
<a href="mailto:[email protected]">mail</a>

//给[email protected][email protected]发送邮件:
<a href="mailto:[email protected],[email protected]">mail</a>

//给[email protected]发送主题为“testing”的邮件:
<a href="mailto:[email protected]?subject=Testing">mail</a>

//给[email protected]发送主题为“testing”的邮件,并抄送给[email protected]:
<a href="mailto:[email protected]?subject=Testing mailto&[email protected]">mail</a>

4. Android Market

如果希望一个链接能够激活Android市场的功能,可以把链接写成:

<a href="market://search?q=[query]">Android Market link</a>

其中就是搜索的内容,你应用的名称

例:

<a href="market://search?q=MyApp">MyApp</a>

5. GPS地图定位

<a href="geopoint:[经度],[纬度]">我的位置</a>

例:

<a href="geopoint:108.954823,34.275891">我的位置</a>

猜你喜欢

转载自blog.csdn.net/suyimin2010/article/details/82795831