没有合适的资源?快使用搜索试试~ 我知道了~
首页Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面.
Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面.
5星 · 超过95%的资源 需积分: 50 54 下载量 67 浏览量
更新于2023-03-16
评论 1
收藏 28KB DOCX 举报
Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面.
资源详情
资源评论
资源推荐
Android 开发之 Intent 跳转到系统应用中的拨号界面、联系人界面、短信界面
时间:2012 年 08 月 02 日 10:18:46 来源:千锋网 作者:
现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己
整理了一下。
首先,我们先看拨号界面,代码如下:
1. Intent intent =new Intent();
2. intent.setAction("android.intent.action.CALL_BUTTON");
3. startActivity(intent);
复制代码
和
1. Uri uri = Uri.parse("tel:xxxxxx");
2. Intent intent = new Intent(Intent.ACTION_DIAL, uri);
3. startActivity(intent);
复制代码
两者都行
但是如果是跳转到应用,使用一下代码:
1. Intent intent= new Intent("android.intent.action.DIAL");
2. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
复制代码
到通话记录界面:
1. Intent intent=new Intent();
2. intent.setAction(Intent.ACTION_CALL_BUTTON);
3. startActivity(intent);
复制代码
到联系人界面:
1. Intent intent = new Intent();
2. intent.setAction(Intent.ACTION_VIEW);
3. intent.setData(Contacts.People.CONTENT_URI);
4. startActivity(intent);
复制代码
同理,到应用:
1. Intent intent= new Intent("com.android.contacts.action.LIST_STREQUENT");
2. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
复制代码
调用联系人界面:
1. Intent intent = new Intent();
2. intent.setAction(Intent.ACTION_PICK);
3. intent.setData(Contacts.People.CONTENT_URI);
4. startActivity(intent);
复制代码
插入联系人
1. Intent intent=new
Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1"));
2. startActivity(intent);
复制代码
到联系人列表界面
1. Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
2. intent.setType("vnd.android.cursor.item/person");
3. intent.setType("vnd.android.cursor.item/contact");
4. intent.setType("vnd.android.cursor.item/raw_contact");
5. intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name);
6.
intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company);
7. intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);
8. intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE,
3);
复制代码
到短信界面:
1. Intent intent = new Intent(Intent.ACTION_VIEW);
2. intent.setType("vnd.android-dir/mms-sms");
3. // intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码
4. startActivity(intent);
复制代码
到应用:
1. Intent intent = new Intent("android.intent.action.CONVERSATION");
2. startActivity(intent);
复制代码
以下是在网上找到的其他方法:
1.从 google 搜索内容
1. Intent intent = new Intent();
2. intent.setAction(Intent.ACTION_WEB_SEARCH);
3. intent.putExtra(SearchManager.QUERY,"searchString")
4. startActivity(intent);
复制代码
2.浏览网页
1. Uri uri = Uri.parse("http://www.google.com");
2. Intent it = new Intent(Intent.ACTION_VIEW,uri);
3. startActivity(it);
复制代码
3.显示地图
1. Uri uri = Uri.parse("geo:38.899533,-77.036476");
2. Intent it = new Intent(Intent.Action_VIEW,uri);
3. startActivity(it);
复制代码
4.路径规划
1. Uri uri = Uri.parse("http://maps.google.com/maps?f=dsaddr=startLat
%20startLng&daddr=endLat%20endLng&hl=en");
2. Intent it = new Intent(Intent.ACTION_VIEW,URI);
3. startActivity(it);
复制代码
5.拨打电话
剩余13页未读,继续阅读
CJT-鄭策
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2