Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
1、跳转到拨号界面,代码如下:
1)直接拨打
Intent
intentPhone = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" +
phoneNumber));startActivity(intentPhone);
- 2)跳转到拨号界面
Intent
intent = newIntent(Intent.ACTION_DIAL,Uri.parse("tel:" + phoneNumber));intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
2、跳转到联系人页面,使用一下代码:
- Intent intentPhone = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" +
phoneNumber));
startActivity(intentPhone);
以下内容为转载:Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。//安装已经存在的apk
String filePath="mnt/sdcard/abc.apk";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + filePath),
"application/vnd.android.package-archive");
startActivity(intent);//直接跳到安装页面,但是还要点击按钮确定安装,还是取消安装
//卸载某应用
String packageName="org.adw.launcher2"
Uri packageUri = Uri.parse("package:"+packageName);//包名,指定该应用
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);
startActivity(uninstallIntent);
//查看某一应用程序的信息
Uri uri=Uri.parse("package:"+packageName);//包名,指定该应用
Intent intent=new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", uri);
startActivity(intent);
2.浏览网页某一具体网址
Uri uri = Uri.parse("http://xxxxxxxxxxxxxxxxxxxxxxxx");
Intent
intent = new Intent(Intent.ACTION_VIEW,uri);//加下面这句话就是启动系统自带的浏览器打开上面的网址,
不加下面一句话,
如果你有多个浏览器,就会弹出让你选择某一浏览器,
然后改浏览器就会打开该网址...............intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);
//系统
设置
界面Intent intent=new Intent();
intent.setClassName("com.android.settings","com.android.settings.Settings");
startActivity(intent);
//回到桌面吗
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
//系统
拨号
界面Intent intent= new Intent(Intent.ACTION_DIAL);
intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
startActivity(intent);
//系统
通话记录
界面Intent intent =new Intent();
intent.setAction("android.intent.action.CALL_BUTTON");
startActivity(intent);
//拨号
Uri uri = Uri.parse("tel:xxxxxx");
Intent intent = new Intent(Intent.ACTION_DIAL, uri);
startActivity(intent);
//启动拨号界面,指定了类名
包名
是系统的拨号界面
DialtactsActivityIntent intent= new Intent("android.intent.action.DIAL");
intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
startActivity(intent);
//系统
联系人
界面
PeopleActivityIntent intent001 = new Intent();
intent001.setClassName("com.android.contacts","com.android.contacts.activities.PeopleActivity");
startActivity(intent001);
//系统
搜索
界面
SearchActivityIntent intent002=new Intent();
intent002.setClassName("com.android.quicksearchbox", "com.android.quicksearchbox.SearchActivity");
startActivity(intent002);
//启动短信收件箱的界面,指定了包名,类名
Intent intent4
= new Intent();intent4.setClassName("com.android.mms","com.android.mms.ui.ConversationList");
startActivity(intent4);
//启动联系人界面,不好
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
intent.setData(Contacts.People.CONTENT_URI);
startActivity(intent);
插入联系人Intent intent=new Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1"));startActivity(intent);
到联系人列表界面Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
intent.setType("vnd.android.cursor.item/person");intent.setType("vnd.android.cursor.item/contact");intent.setType("vnd.android.cursor.item/raw_contact");intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name);
intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company);
intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);
intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
//启动短信收件箱的界面,指定了包名,类名
Intent intent = new Intent();
intent.setClassName("com.android.mms","com.android.mms.ui.ConversationList");startActivity(intent);
//启动编辑短信的界面
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android-dir/mms-sms");// intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码startActivity(intent);
- Intent intentPhone = new Intent(Intent.ACTION_CALL,
Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面的更多相关文章
- Android开发中使用Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
现在开发中的功能需要直接跳转到拨号.联系人.短信界面等等,查找了很多资料,自己整理了一下. 首先,我们先看拨号界面,代码如下: Intent intent =new Intent(); intent. ...
- Intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
现在开发中的功能需要直接跳转到拨号.联系人.短信界面等等,查找了很多资料,自己整理了一下. 首先,我们先看拨号界面,代码如下: Intent intent =new Intent(); intent. ...
- android开发之Intent.setFlags()_让Android点击通知栏信息后返回正在运行的程序
android开发之Intent.setFlags()_让Android点击通知栏信息后返回正在运行的程序 在应用里使用了后台服务,并且在通知栏推送了消息,希望点击这个消息回到activity ...
- Android开发之Intent略解
Intent是一种运行时绑定(run-time binding)机制,它能在程序运行过程中连接两个不同的组件.通过Intent,你的程序可以向Android表达某种请求或者意愿,Android会根据意 ...
- Android开发之Intent.Action
1 Intent.ACTION_MAIN String: android.intent.action.MAIN 标识Activity为一个程序的開始.比較经常使用. Input:nothing Out ...
- Android开发之Intent.Action 各种Action的常见作用
1 Intent.ACTION_MAIN String: android.intent.action.MAIN 标识Activity为一个程序的开始.比较常用. Input:nothing Outpu ...
- Android开发之Intent.Action Android中Intent的各种常见作用
1 Intent.ACTION_MAIN String: android.intent.action.MAIN 标识Activity为一个程序的开始.比较常用. Input:nothing Outpu ...
- Android开发之Intent的传值--Application
每当我们想要将输入的值传递到多个界面时,只是使用Intent传值的话,就会有一些的弊端. 下面我就以三个页面为例,进行简单的说明一下: 思路: 1.第一个页面是客户输入相关的信息. 2.将客户输入的信 ...
- android开发之Fragment加载到一个Activity中
Fragments 是android3.0以后添加的.主要是为了方便android平板端的开发.方便适应不同大小的屏幕.此代码是为了最简单的Fragment的使用,往一个Activity中添加Frag ...
随机推荐
- 在Windows中隐藏用户的方法
这两天新建了一个用户用于共享文件,由于我的电脑只有我一个人用,多了一个用户后在登录界面上觉得挺碍事的,便想把它隐藏起来.找了一下,可以通过如下方式实现: 在注册表编辑器新建项值: HKEY_LOCAL ...
- SQL Server 堆表与栈表的对比(大表)
环境准备 使用1个表,生成1000万行来进行性能对比(勉强也算比较大了),对比性能差别. 为了简化过程,不提供生成随机数据的过程.该表初始为非聚集索引(堆表),测试过程中会改为聚集索引(栈表). CR ...
- NOIP2015 斗地主(搜索+剪枝)
4325: NOIP2015 斗地主 Time Limit: 30 Sec Memory Limit: 1024 MBSubmit: 270 Solved: 192[Submit][Status] ...
- 【UER #1】跳蚤OS(Trie)
跳蚤OS 是跳蚤国自主研发的功能强大的操作系统. 跳蚤OS的文件系统与普通的文件系统类似,是个文件夹套文件夹的结构.文件系统根目录称为“//”.我们可以用文件路径来表明文件所在的位置,比如“/flea ...
- JUnit学习总结
Junit简介: Junit最初是由Erich Gamma 和 Kent Beck 编写的一个回归测试框架(regression testing framework),为单元测试(Unit Test) ...
- 算法导论学习-Dynamic Programming
转载自:http://blog.csdn.net/speedme/article/details/24231197 1. 什么是动态规划 ------------------------------- ...
- POJ1838
poj 1838 这道题主要是对并查集的考察,在这道题的解题过程中主要用到的算法就是并查集中的最基本的makeSet,findSet,unionSet 即前篇文章中所提到的: makeSet(Elem ...
- php学习小记1
1.回调函数 c语言中的回调函数:通过函数指针调用的函数.将函数a的指针(地址)作为参数传递给另一个函数b,当函数a的指针被b用来调用a时,这就是回调函数,在特定的事件或条件发生时,由另外一方调用,用 ...
- Devlop Win 8 and Windows Phone App for Microsoft Dynamics CRM
Microsoft Dynamics CRM App for Windows Phone http://www.windowsphone.com/en-us/store/app/dynamics-cr ...
- Replacing JNI Crashes by Exceptions on Android
http://blog.httrack.com/blog/2013/08/23/catching-posix-signals-on-android/ To Report Or Not To Repor ...