Android 使用 ACTION_CALL 拨号

 

1.在AndroidManifest.xml 中申请权限:<uses-permission  android:name="android.permission.CALL_PHONE" />

2.把电话号码转换成 Uri

2.1. String telstr = String.fromat("tel:%s", 手机号字符串);
2.2. Uri telUri =  Uri.parse(telstr);

3. 在 Intent 中设置 ACTION_CALL 和 telUri

3.1. Intent intent = new Intent(Intent.ACTION_CALL, telUri);

4.拨号

4.1. context.startActivity(intent);



posted @ 2013-01-31 18:15  playerc  阅读(762)  评论(0编辑  收藏  举报
c4io.com Count Visitors
Web Counter