没有合适的资源?快使用搜索试试~ 我知道了~
Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面.
5星 · 超过95%的资源 需积分: 50 54 下载量 32 浏览量
2013-06-27
11:25:21
上传
评论 1
收藏 28KB DOCX 举报
温馨提示
试读
14页
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页未读,继续阅读
资源评论
- wowoxixi2014-05-16例子比较简单明了,非常适合新手
- 与向日葵有个约会2014-08-06例子比较简明扼要,谢谢分享。
CJT-鄭策
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于SpringBoot+Vue3快速开发平台、自研工作流引擎源码设计.zip
- docker安装部署全流程
- 基于树莓派的人脸识别系统python源码+项目部署说明+超详细代码注释.zip
- Python和R爬取分析赶集网北京二手房数据.zip
- Python和R爬取分析赶集网北京二手房数据.zip
- Java知识体系最强总结(2021版).txt
- Python知识点Python知识点Python知识点Python知识点Python知识点PythonPython知识点.txt
- Java开发基于seetaface6的人脸识别(活体检测)的封装源码.zip
- JSP在线失物招领管理平台源码.zip
- JSP在线旅游美食展现管理系统源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功