android短信的uri,Android系统Intent中的Uri使用

Intent应该算是Android中特有的东西。你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料。都指定好后,只要调用startActivity(),Android系统会自动寻找最符合你指定要求的应用程序,并执行该程序。

★intent大全:

1.从google搜索内容

Intent intent =newIntent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY,"searchString") startActivity(intent);

2.浏览网页

Uri uri =Uri.parse("http://www.google.com");Intent it =newIntent(Intent.ACTION_VIEW,uri);startActivity(it);

3.显示地图

Uri uri = Uri.parse("geo:38.899533,-77.036476");Intent it = newIntent(Intent.Action_VIEW,uri);startActivity(it);

4.路径规划

Uri uri =Uri.parse("http://maps.google.com/maps?    f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en"); Intent it = newIntent(Intent.ACTION_VIEW,URI); startActivity(it);

5.拨打电话

Uri uri =Uri.parse("tel:xxxxxx"); Intent it =newIntent(Intent.ACTION_DIAL,uri);  startActivity(it);

6.调用发短信的程序

Intent it = newIntent(Intent.ACTION_VIEW);    it.putExtra("sms_body","TheSMS text");    it.setType("vnd.android-dir/mms-sms");  startActivity(it);

7.发送短信

Uri uri =Uri.parse("smsto:0800000123");  Intent it = newIntent(Intent.ACTION_SENDTO, uri);  it.putExtra("sms_body","TheSMS text");  startActivity(it);Stringbody="this is sms demo";Intent mmsintent = newIntent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number,null));mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY,body);mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE,true);mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT,true);startActivity(mmsintent);

8.发送彩信

Uri uri =Uri.parse("content://media/external/images/media/23");  Intent it = newIntent(Intent.ACTION_SEND);  it.putExtra("sms_body","some text");  it.putExtra(Intent.EXTRA_STREAM, uri);  it.setType("image/png");  startActivity(it);StringBuilder sb =newStringBuilder();sb.append("file://");sb.append(fd.getAbsoluteFile());Intent intent = newIntent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number,null));// Below extra datas are all optional.intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT,subject);intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY,body);intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI,sb.toString());intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE,composeMode);intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT,exitOnSent);startActivity(intent);

9.发送Email

Uri uri =Uri.parse("mailto:xxx@abc.com");Intent it = newIntent(Intent.ACTION_SENDTO, uri);startActivity(it);Intent it =newIntent(Intent.ACTION_SEND);  it.putExtra(Intent.EXTRA_EMAIL,"me@abc.com");  it.putExtra(Intent.EXTRA_TEXT,"Theemail body text");  it.setType("text/plain");  startActivity(Intent.createChooser(it,"Choose Email Client"));Intent it=newIntent(Intent.ACTION_SEND);String[] tos={"me@abc.com"};String[]ccs={"you@abc.com"};    it.putExtra(Intent.EXTRA_EMAIL, tos);    it.putExtra(Intent.EXTRA_CC, ccs);    it.putExtra(Intent.EXTRA_TEXT,"Theemail body text");    it.putExtra(Intent.EXTRA_SUBJECT,"Theemail subject text");    it.setType("message/rfc822");    startActivity(Intent.createChooser(it,"Choose Email Client"));  Intent it = newIntent(Intent.ACTION_SEND);  it.putExtra(Intent.EXTRA_SUBJECT,"Theemail subject text");    it.putExtra(Intent.EXTRA_STREAM,"file:///sdcard/mysong.mp3");  sendIntent.setType("audio/mp3");  startActivity(Intent.createChooser(it,"Choose Email Client"));

10.播放多媒体

Intent it =newIntent(Intent.ACTION_VIEW);Uri uri =Uri.parse("file:///sdcard/song.mp3");it.setDataAndType(uri,"audio/mp3");startActivity(it);Uri uri =Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,"1");  Intent it =newIntent(Intent.ACTION_VIEW,uri);  startActivity(it);

11.uninstall apk

Uri uri =Uri.fromParts("package", strPackageName,null);  Intent it = newIntent(Intent.ACTION_DELETE, uri);  startActivity(it);

12.install apk

UriinstallUri = Uri.fromParts("package","xxx", null);returnIt= newIntent(Intent.ACTION_PACKAGE_ADDED, installUri);

打开照相机

<1>Intent i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);  this.sendBroadcast(i);  <2>long dateTaken = System.currentTimeMillis();  String name = createName(dateTaken) +".jpg";  fileName = folder + name;  ContentValuesvalues= new ContentValues();values.put(Images.Media.TITLE, fileName);values.put("_data", fileName);values.put(Images.Media.PICASA_ID, fileName);values.put(Images.Media.DISPLAY_NAME, fileName);values.put(Images.Media.DESCRIPTION, fileName);values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileName);  Uri photoUri = getContentResolver().insert(            MediaStore.Images.Media.EXTERNAL_CONTENT_URI,values);  Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);  startActivityForResult(inttPhoto,10);

14.从gallery选取图片

Intent i =newIntent();      i.setType("image/*");      i.setAction(Intent.ACTION_GET_CONTENT);      startActivityForResult(i,11);

打开录音机

Intent mi =newIntent(Media.RECORD_SOUND_ACTION);  startActivity(mi);

16.显示应用详细列表

Uri uri =Uri.parse("market://details?id=app_id");        Intent it =newIntent(Intent.ACTION_VIEW,uri);        startActivity(it);//where app_id is the application ID, findthe ID//by clicking on your application on Markethome//page, and notice the ID from the addressbar刚才找app id未果,结果发现用packagename也可以 Uri uri =Uri.parse("market://details?id="); 这个简单多了

17寻找应用

Uri uri =Uri.parse("market://search?q=pname:pkg_name");        Intent it =newIntent(Intent.ACTION_VIEW,uri);        startActivity(it);//where pkg_name is the full package pathfor an application

18打开联系人列表

<1>                Intent i =newIntent();      i.setAction(Intent.ACTION_GET_CONTENT);      i.setType("vnd.android.cursor.item/phone");      startActivityForResult(i, REQUEST_TEXT);      <2>      Uri uri = Uri.parse("content://contacts/people");      Intent it =newIntent(Intent.ACTION_PICK, uri);      startActivityForResult(it, REQUEST_TEXT);

19 打开另一程序

Intent i =newIntent();      ComponentName cn = newComponentName("com.yellowbook.android2","com.yellowbook.android2.AndroidSearch");      i.setComponent(cn);      i.setAction("android.intent.action.MAIN");      startActivityForResult(i, RESULT_OK);

20.调用系统编辑添加联系人(高版本SDK有效):

Intent it = newIntent(Intent.ACTION_INSERT_OR_EDIT);          it.setType("vnd.android.cursor.item/contact");//it.setType(Contacts.CONTENT_ITEM_TYPE);it.putExtra("name","myName");          it.putExtra(android.provider.Contacts.Intents.Insert.COMPANY,"organization");          it.putExtra(android.provider.Contacts.Intents.Insert.EMAIL,"email");            it.putExtra(android.provider.Contacts.Intents.Insert.PHONE,"homePhone");            it.putExtra(android.provider.Contacts.Intents.Insert.SECONDARY_PHONE,"mobilePhone");            it.putExtra(  android.provider.Contacts.Intents.Insert.TERTIARY_PHONE,"workPhone");          it.putExtra(android.provider.Contacts.Intents.Insert.JOB_TITLE,"title");            startActivity(it);

21.调用系统编辑添加联系人(全有效):

Intent intent = newIntent(Intent.ACTION_INSERT_OR_EDIT);      intent.setType(People.CONTENT_ITEM_TYPE);      intent.putExtra(Contacts.Intents.Insert.NAME,"My Name");      intent.putExtra(Contacts.Intents.Insert.PHONE,"+1234567890");      intent.putExtra(Contacts.Intents.Insert.PHONE_TYPE,Contacts.PhonesColumns.TYPE_MOBILE);      intent.putExtra(Contacts.Intents.Insert.EMAIL,"com@com.com");      intent.putExtra(Contacts.Intents.Insert.EMAIL_TYPE,                    Contacts.ContactMethodsColumns.TYPE_WORK);      startActivity(intent);

★intent action大全:

android.intent.action.ALL_APPS

android.intent.action.ANSWER

android.intent.action.ATTACH_DATA

android.intent.action.BUG_REPORT

android.intent.action.CALL

android.intent.action.CALL_BUTTON

android.intent.action.CHOOSER

android.intent.action.CREATE_LIVE_FOLDER

android.intent.action.CREATE_SHORTCUT

android.intent.action.DELETE

android.intent.action.DIAL

android.intent.action.EDIT

android.intent.action.GET_CONTENT

android.intent.action.INSERT

android.intent.action.INSERT_OR_EDIT

android.intent.action.MAIN

android.intent.action.MEDIA_SEARCH

android.intent.action.PICK

android.intent.action.PICK_ACTIVITY

android.intent.action.RINGTONE_PICKER

android.intent.action.RUN

android.intent.action.SEARCH

android.intent.action.SEARCH_LONG_PRESS

android.intent.action.SEND

android.intent.action.SENDTO

android.intent.action.SET_WALLPAPER

android.intent.action.SYNC

android.intent.action.SYSTEM_TUTORIAL

android.intent.action.VIEW

android.intent.action.VOICE_COMMAND

android.intent.action.WEB_SEARCH

android.net.wifi.PICK_WIFI_NETWORK

android.settings.AIRPLANE_MODE_SETTINGS

android.settings.APN_SETTINGS

android.settings.APPLICATION_DEVELOPMENT_SETTINGS

android.settings.APPLICATION_SETTINGS

android.settings.BLUETOOTH_SETTINGS

android.settings.DATA_ROAMING_SETTINGS

android.settings.DATE_SETTINGS

android.settings.DISPLAY_SETTINGS

android.settings.INPUT_METHOD_SETTINGS

android.settings.INTERNAL_STORAGE_SETTINGS

android.settings.LOCALE_SETTINGS

android.settings.LOCATION_SOURCE_SETTINGS

android.settings.MANAGE_APPLICATIONS_SETTINGS

android.settings.MEMORY_CARD_SETTINGS

android.settings.NETWORK_OPERATOR_SETTINGS

android.settings.QUICK_LAUNCH_SETTINGS

android.settings.SECURITY_SETTINGS

android.settings.SETTINGS

android.settings.SOUND_SETTINGS

android.settings.SYNC_SETTINGS

android.settings.USER_DICTIONARY_SETTINGS

android.settings.WIFI_IP_SETTINGS

android.settings.WIFI_SETTINGS

android.settings.WIRELESS_SETTINGS

http://segmentfault.com/a/1190000000646719

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/552481.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

简单html5作品,最新HTML5简单入门系列精选

随着HTML5的流行&#xff0c;LZ作为一个web开发者&#xff0c;也决定学习一下前端前沿技术。HTML5 是下一代的HTML&#xff0c;它将成为 HTML、XHTML 以及 HTML DOM 的新标准。它是W3C( World Wide Web Consortium)和WHATWG(Web Hypertext Application Technology Working Grou…

js在ie追加html,如何使用JavaScript将属性添加/更新到HTML元素?

如果你想要完全兼容&#xff0c;看起来容易的事实上是很棘手的。var e document.createElement(div);假设您要添加“div1”的ID。e[id] div1;e.id div1;e.attributes[id] div1;e.createAttribute(id,div1)这些都将工作&#xff0c;除了IE 5.5中的最后一个(这是古代历史&…

标题显示字数限制 html css,【紧急】我想问一下HTML的TITLE标签,里面的内容能填写多少个?有限制吗_html/css_WEB-ITnose...

我想问一下HTML的TITLE标签&#xff0c;里面的内容能填写多少个&#xff1f;有限制吗另外如果提高搜索引擎访问的质量&#xff0c;把我的网站排列在前面除了title和meta里面多放些关键词之外我还需要做什么&#xff1f;回复讨论(解决方案)title写太多没用。。。关键字就好了你到…

html实现图片加载动画效果,HTML5+javascript实现图片加载进度动画效果

在网上找资料的时候&#xff0c;看到网上有图片加载进度的效果&#xff0c;手痒就自己也写了一个。图片加载完后&#xff0c;隐藏loading效果。想看加载效果&#xff0c;请ctrelF5强制刷新或者清理缓存。效果预览&#xff1a;0%代码如下&#xff1a;HTML5javascript实现图片加载…

织梦html权限设置,详细的Dede织梦目录权限安全设置教程

用户织梦建站&#xff0c;网站安全不可忽视。给大家分享织梦各目录的安全设置教程。以供参考。/ 【站点上级目录】假如要使用后台的目录相关的功能需求有列出目录的权限 //0444/ 【站点根目录】需求执行和读取权限 假如要在根目录下面创建文件和目录的话需求有写入权限 //0755/…

html页面左右布局透明背景,HTML透明背景

我想创建一个透明背景,表格和一些文本的网页.我见过与此相关的帖子,但由于我对css不熟悉,我不知道怎么办我的代码才能运行.我只想要一个透明的背景,而这段代码让一切都变得透明.有人可以帮助.Toll ChargesClass 2 inc Private A$4.95 Class 2 inc Commercial A$13.95 …

html5开发app的缺点,全解HTML 5在移动Web应用的优劣势

关于HTML5HTML5具有语义学、本地存储、设备访问、连接性、多媒体、平面和三维效果、性能和集成和CSS3八大技术特征。让Web应用进入无插件时代&#xff0c;在功能和性能上逼近桌面应用。促使应用Web化&#xff0c;实现跨平台。HTML5规范草案将于2012年发布候选推荐版&#xff0c…

html怎么加断点快捷键,HTML添加断点 - osc_vyztkm1b的个人空间 - OSCHINA - 中文开源技术交流社区...

###1.前言 很多时候&#xff0c;页面的dom元素是动态添加的&#xff0c;而我们不知道具体是哪段js代码在操作这个dom元素&#xff0c;所以需要进行断点&#xff0c;对相应的dom元素进行断点监听&#xff0c;这样才能找出相关的js代码。在浏览器的调试工具中&#xff0c;切到ele…

黑群晖找不到设备_黑群晖洗白算号器SN、MAC地址

可算DX3615xs及DS3617xs SN号与MAC号运行程序每次执行生成20组SN号&#xff0c;选其中一个即可。祝你好运&#xff01;&#xff01;&#xff01;生成DS3615xs SN序列号&#xff1a; 【1】 生成DS3617xs SN序列号&#xff1a; 【2】 生成网卡MAC序列号&#xff1a; 【3】 退…

html5 canvas 图像预览,html5-canvas 加载并显示图像

示例加载图像并将其放置在画布上var image new Image(); // 请参阅有关创建图像的注释image.src "imageURL";image.onload function(){ctx.drawImage(this,0,0);}创建图像有几种创建图像的方法new Image()document.createElement("img")作为HTML正文的…

施工部署主要不包括_专项施工方案编制至少应该包括以下内容及管片选型主要依据以下原则...

一、专项施工方案编制至少应该包括以下内容1、工程概况&#xff1a;分部分项工程概况、施工平面布置、施工要求和技术保证条件等。 2、 编制依据&#xff1a;相关法律、法规、规范、标准及图纸&#xff08;国标图集&#xff09;、施工组织设计等。 3、施工工艺技术&#xff1a;…

html能插入背景的行级元素,Html元素类型:块级元素、行内元素(内联元素)和行内块级元素...

8种机械键盘轴体对比本人程序员&#xff0c;要买一个写代码的键盘&#xff0c;请问红轴和茶轴怎么选&#xff1f;html中的标签元素大体被分为三种不同的类型&#xff1a;块级元素、内联元素(又叫行内元素)和内联块级元素。事实上&#xff0c;我以前用的时候只是建立在对它们的初…

fox pro删除单条数据_Mac文件夹数据同步工具——Sync Folders Pro

Mac版同步文件夹Pro&#xff08;文件夹数据同步工具&#xff09;分享给大家&#xff01;Mac版同步文件夹Pro是一种功能强大的文件夹数据同步工具&#xff0c;可帮助您同步两一个文件夹的内容&#xff0c;包括任何子文件夹。使用文件夹同步软件&#xff0c;允许您在任一方向或两…

初中生学计算机视频,推荐一下适合中学生的在线视频学习网站

英语语法省略句精讲一、并列复合句中某些相同成分的省略。1. This beeper works well&#xff0c;but that one doesnt (work well).这个寻呼机工作正常&#xff0c;但那个就不行。2. All uranium atoms do not have the same atomic weight. Some of them weigh 234 units&…

bp神经网络预测未来五年数据_预测 | 未来五年以太网收发器出货将达2.75亿只

新闻导读LC最新预测表明&#xff0c;从2021年到2025年间&#xff0c;供应商将售出2.75亿只以太网收发器&#xff0c;为其带来240亿美元的收入。但由于激烈的竞争、电信和企业网络投资的放缓&#xff0c;以及中美敌对升级可能导致中国云数据中心升级的延迟&#xff0c;LC下调了未…

计算机知识竞赛决赛流程,计算机知识竞赛决赛圆满结束!还不快戳?!

原标题&#xff1a;计算机知识竞赛决赛圆满结束&#xff01;还不快戳&#xff1f;&#xff01;温 馨 提 示 &#xff1a;热烈庆祝&#xff1a;青海大学 “计算机知识竞赛”圆满结束&#xff01;计算机莅临本场比赛的嘉宾有&#xff1a;计算机协会指导老师&#xff1a;贾金芳老师…

开关造成的毛刺_玻璃面板开关钻孔加工

玻璃面板开关&#xff0c;也叫做钢化玻璃开关。与传统的面板开关不同在于它是用钢化玻璃制作而成&#xff0c;但是同样能够达到控制电路的作用&#xff0c;这种开关的设计理念是为了能够达到简约时尚的作用&#xff0c;同时也具有美观与安全性&#xff0c;可以说是受到许多家庭…

大工14春《计算机应用基础》在线测试2,大工14春《计算机应用基础》在线测试2...

大工14春《计算机应用基础》在线测试2单选题 判断题一、单选题(共 10 道试题&#xff0c;共 40 分。)1. 在Excel 2010中&#xff0c;存储数据的表格被称为()。A. 文件B. 文件夹C. 工作表D. 图表-----------------选择&#xff1a;C2. 如果改变Excel 2010工作表的打印方向(如横向…

python应声虫代码_前端大牛们都学过哪些东西?

一步一步来。CSS不能编程&#xff1f;用Less、Sass、Stylus、甚至直接用 Absurd&#xff0c;框架除了Bootstrap还有很多。JS写多了很麻烦&#xff1f;jQuery。移动开发&#xff1f;Zepto.js。结构不好&#xff1f;找框架&#xff0c;Backbone.js是MVC&#xff0c;AngularJS和Em…

html播放rtsp流,浏览器播放rtsp视频流解决方案

最近项目中需要实时播放摄像头rtsp视频流&#xff0c;于是就专门做了些研究。而浏览器不能直接播放&#xff0c;只有通过插件或者转码来实现这个需求。要实现这个目的&#xff0c;可以采用的方案非常得多&#xff0c;有商业的也有开源的&#xff0c;这里主要列举一些开源的方案…