调用android 中的拨号功能、调用某个联系人信息、调用对默认号码的短信
16lz
2021-01-24
/** * 调用拨号功能 * @param strCon */public void CallPhone(String strCon) {// TODO Auto-generated method stubIntent intent=null;Toast.makeText(getApplicationContext(), "电话:"+strCon,Toast.LENGTH_SHORT).show();intent=new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+strCon));//短信//Intent intent = new Intent(Intent.ACTION_SENDTO,Uri.parse("smsto:"+strCon)); startActivity(intent); }/** * 调用查看联系人相关信息 * @param id 为联系人表contacts 中_id */public void CallView(String id){Intent intent=null;intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("content://contacts/people/"+id));startActivity(intent); }
更多相关文章
- android调用系统发送短信 和 已发送短信界面
- Android之---RecycleView实现简单的图片查看功能(类似相册查看器)
- Android(安卓)-- 零散记录[短信发送,系统拨号,单元测试]
- Android(安卓)Studio 发布Jar ,aar 到Maven
- 7.Android(安卓)自定义Loader
- android如何获取手机联系人的数据库
- android实现文件下载功能
- android 9.0系统重启的代码详解
- flutter集成推送功能-小米推送集成