相当一部分来自文档,希望能有朋友继续完善此贴,以作搜藏。
显示网页:
1. Uri uri = Uri.parse("http://www.google.com");
2. Intent it = new Intent(Intent.ACTION_VIEW,uri);
3. startActivity(it);
显示地图:
1. Uri uri = Uri.parse("geo:38.899533,-77.036476");
2. Intent it = new Intent(Intent.Action_VIEW,uri);
3. startActivity(it);
路径规划:
1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
2. Intent it = new Intent(Intent.ACTION_VIEW,URI);
3. startActivity(it);
拨打电话:
调用拨号程序
1. Uri uri = Uri.parse("tel:xxxxxx");
2. Intent it = new Intent(Intent.ACTION_DIAL, uri);
3. startActivity(it);
1. Uri uri = Uri.parse("tel.xxxxxx");
2. Intent it =new Intent(Intent.ACTION_CALL,uri);
3. 要使用这个必须在配置文件中加入<uses-permission id="android.permission.CALL_PHONE"></uses-permission>
发送SMS/MMS
调用发送短信的程序
1. Intent it = new Intent(Intent.ACTION_VIEW);
2. it.putExtra("sms_body", "The SMS text");
3. it.setType("vnd.android-dir/mms-sms");
4. startActivity(it);
发送短信
1. Uri uri = Uri.parse("smsto:0800000123");
2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
3. it.putExtra("sms_body", "The SMS text");
4. startActivity(it);
发送彩信
1. Uri uri = Uri.parse("content://media/external/images/media/23");
2. Intent it = new Intent(Intent.ACTION_SEND);
3. it.putExtra("sms_body", "some text");
4. it.putExtra(Intent.EXTRA_STREAM, uri);
5. it.setType("image/png");
6. startActivity(it);
发送Email
1.
2. Uri uri = Uri.parse("mailto:xxx@abc.com");
3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
4. startActivity(it);
1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");
3. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
4. it.setType("text/plain");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));
1. Intent it=new Intent(Intent.ACTION_SEND);
2. String[] tos={"me@abc.com"};
3. String[] ccs={"you@abc.com"};
4. it.putExtra(Intent.EXTRA_EMAIL, tos);
5. it.putExtra(Intent.EXTRA_CC, ccs);
6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
7. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
8. it.setType("message/rfc822");
9. startActivity(Intent.createChooser(it, "Choose Email Client"));
添加附件
1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
3. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
4. sendIntent.setType("audio/mp3");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));
播放多媒体
1.
2. Intent it = new Intent(Intent.ACTION_VIEW);
3. Uri uri = Uri.parse("file:///sdcard/song.mp3");
4. it.setDataAndType(uri, "audio/mp3");
5. startActivity(it);
1. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
2. Intent it = new Intent(Intent.ACTION_VIEW, uri);
3. startActivity(it);
Uninstall 程序
1. Uri uri = Uri.fromParts("package", strPackageName, null);
2. Intent it = new Intent(Intent.ACTION_DELETE, uri);
3. startActivity(it);
分享到:
相关推荐
android 利用intent调用activity 简明精炼的例子 传递数据,并且有返回值
android调用系统邮件组件 Intent匹配流程 csdn博客地址
Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //设置intent的Action属性 intent.setAction(Intent.ACTION_VIEW); //获取文件file的MIME类型 String type = getMIMEType...
android 系统调用WPS打开word excel ppt pdf 等,将代码类移入的你项目,有对6.0 7.0及以上系统做文件读取方法
应开发需要,不想调用第三方库实现功能。调用系统相机拍照,系统相册进行多选。注意多选照片时要长按一张图片变为多选。
本文档记载了常用的几个系统组件的启动关键代码 action 和category data的值
Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面.
Android7.0 Intent打开文件管理器 获取文件真实路径。虽然网上很多demo,但是没有一个能够兼容所有Android机的,去网上学习了然后自己亲测过手机分别有Android7.0/6.0/4.3个版本。
Android调用系统分享文本信息、单张图片、多个文件和指定分享到微信、QQ的实例代码: //www.jb51.net/article/112057.htm 同时分享图片和文字 private void share(String content, Uri uri){ Intent shareIntent =...
Android 用Intent调用系统中经常被用到的组件 android用于打开各种文件的intent
Android_Intent详解
Intent在Android应用开发中,占有很大的分量,关于Intent在Android中的作用在网络上已经有很多资料了,这里不再累赘,本人喜欢直来直去。在网上看到很多关于Intent的资料,说那么多,你也许还是一头雾水,到底如何...
开发Android软件时,常常需要打开系统设置或信息界面,来设置相关系统项或查看系统的相关信息,这时我们就可以使用以下语句来实现:(如打开“无线和网络设置”界面)
Android的Intent方式拍照源代码,具体文章请参考:http://blog.csdn.net/gobitan/article/details/9158825
Intent是Android中用来调用其它组件的类,通过Intent,我们可以非常方便的调用Activity,Broadcast Receiver和Service。 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse...
在Android中,调用Email有三种类型的Intent: Intent.ACTION_SENDTO 无附件的发送 Intent.ACTION_SEND 带附件的发送 Intent.ACTION_SEND_MULTIPLE 带有多附件的发送 当然,所谓的调用Email,只是说Email可以接收...
显示意图:调用intent.setComponent()、intent.setClassName()或者intent.setClass()方法明确的制定组件名的Intent为显示意图,显示意图明确的制定要激活哪一个组件。 隐士意图:没有明确的制定组件的名称;下边是一...
添加本地图片和调用系统拍照图片主要是通过调用acitivity跳转startActivityForResult Intent intent int requestCode 方法和activity返回结果onActivityResult int requestCode int resultCode Intent data 方法来...
主要介绍了Android Intent调用 Uri的方法总结的相关资料,这里整理了Android Intent 调用Uri的常用方法,需要的朋友可以参考下
主要介绍了Android 通过Intent调用系统拍照程序出现图片太小的问题解决办法的相关资料,需要的朋友可以参考下