位置: 编程技术 - 正文

android Intent的常用参数解说(android intent作用)

编辑:rootadmin
&#;&#;

推荐整理分享android Intent的常用参数解说(android intent作用),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:android的intent介绍,android intent用法,android intent作用,在android应用开发中,intent有什么样的功能,android 中intent的作用有哪些,android intent用法,android intent用法,android中的intent,内容如对您有帮助,希望把文章链接给更多的朋友!

1 Intent.ACTION_MAIN

String: android.intent.action.MAIN

标识Activity为一个程序的开始。比较常用。

Input:nothing

Output:nothing

<activity android:name=".Main" android:label="@string/app_name"> <intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity>

2 Intent.Action_CALL

Stirng: android.intent.action.CALL

呼叫指定的电话号码。

Input:电话号码。数据&#;式为:tel:&#;phone number

Output:Nothing

Intent intent=new Intent();

intent.setAction(Intent.ACTION_CALL); intent.setData(Uri.parse("tel:");startActivity(intent);

3 Intent.Action.DIAL

String: action.intent.action.DIAL

调用拨号面板

Intent intent=new Intent();

intent.setAction(Intent.ACTION_DIAL);

//android.intent.action.DIALintent.setData(Uri.parse("tel:");startActivity(intent);

Input:电话号码。数据&#;式为:tel:&#;phone number

Output:Nothing

说明:打开Android的拨号UI。如果没有设置数据,则打开一个空的UI,如果设置数据,action.DIAL则通过调用getData()获取电话号码。

但设置电话号码的数据&#;式为 tel:&#;phone number.

4 Intent.Action.ALL_APPS

String: andriod.intent.action.ALL_APPS

列出所有的应用。

Input:Nothing.

Output:Nothing.

5 Intent.ACTION_ANSWER

Stirng:android.intent.action.ANSWER

处理呼入的电话。

Input:Nothing.

Output:Nothing.

6 Intent.ACTION_ATTACH_DATA

String: android.action.ATTCH_DATA

别用于指定一些数据应该附属于一些其他的地方,例如,图片数据应该附属于联系人

Input: Data

Output:nothing

7 Intent.ACTION_BUG_REPORT

String: android.intent.action.BUG_REPORT

显示Dug报告。

Input:nothing

output:nothing

8 Intent.Action_CALL_BUTTON

String: android.action.intent.CALL_BUTTON.

相当于用户按下“拨号”键。经测试显示的是“通话记录”

android Intent的常用参数解说(android intent作用)

Input:nothing

Output:nothing

Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);startActivity(intent);

9 Intent.ACTION_CHOOSER

String: android.intent.action.CHOOSER

显示一个activity选择器,允许用户在进程之前选择他们想要的,与之对应的是Intent.ACTION_GET_CONTENT.

. Intent.ACTION_GET_CONTENT

String: android.intent.action.GET_CONTENT

允许用户选择特殊种类的数据,并返回(特殊种类的数据:照一张相片或录一段音)

Input: Type

Output:URI

int requestCode = ;Intent intent = new Intent(Intent.ACTION_GET_CONTENT); // "android.intent.action.GET_CONTENT"intent.setType("image/*"); // 查看类型,如果是其他类型,比如视频则替换成 video/*,或 */*Intent wrapperIntent = Intent.createChooser(intent, null);

startActivityForResult(wrapperIntent, requestCode);

Intent.ACTION_VIEW

String android.intent.action.VIEW

用于显示用户的数据。

比较通用,会根据用户的数据类型打开相应的Activity。

比如 tel:打开拨号程序, uri = Uri.parse(" //浏览器 Uri uri =Uri.parse("tel:"); //拨号程序 Uri uri=Uri.parse("geo:.,."); //打开地图定位 Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it);

//播放视频 Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse(" intent.setDataAndType(uri, "video/*"); startActivity(intent);//调用发送短信的程序 Intent it = new Intent(Intent.ACTION_VIEW);it.putExtra("sms_body", "信息内容..."); it.setType("vnd.android-dir/mms-sms"); startActivity(it);

Intent.ACTION_SENDTO

String: android.intent.action.SENDTO 说明:发送短信息

//发送短信息 Uri uri = Uri.parse("smsto:"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "信息内容..."); startActivity(it);

//发送彩信,设备会提示选择合适的程序发送 Uri uri = Uri.parse(" //设备中的资源(图像或其他资源) Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra("sms_body", "内容"); intent.putExtra(Intent.EXTRA_STREAM, uri); intent.setType("image/png"); startActivity(it);

//Email Intent intent=new Intent(Intent.ACTION_SEND); String[] tos={"android1@.com"}; String[] ccs={"you@yahoo.com"}; intent.putExtra(Intent.EXTRA_EMAIL, tos); intent.putExtra(Intent.EXTRA_CC, ccs);intent.putExtra(Intent.EXTRA_TEXT, "The email body text"); intent.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); intent.setType("message/rfc"); startActivity(Intent.createChooser(intent, "Choose Email Client"));

Intent.ACTION_EDIT

为指定的数据显示可编辑界面

Intent.ACTION_PICK

从数据中选择一个项目(item),将被选中的项目返回

Intent.ACTION_SEND

给别人提供一些数据

Intent.ACTION_DELETE

从容器中删除给定的数据

Intent.ACTION_INSERT

在容器中插入一个空项目(item)

Intent.ACTION_RUN

运行数据(指定的应用),无论它(应用)是什么

Intent. EXTRA_INTENT

附加数据:和ACTION_PICK_ACTIVITY一起使用时,说明用户选择的用来显示的activity;和ACTION_ADD_SHORTCUT一起使用时,描述要添加的快捷方式

Intent.ACTION_PICK_ACTIVITY

选择一个activity,返回被选择的activity的类名

Intent.ACTION_ SEARCH

执行搜索

Intent.ACTION_SYC

执行数据同步

【Android】保存Fragment切换状态 FragmentPagerAdapter 前言一般频繁切换Fragment会导致频繁的释放和创建,如果Fragment比较臃肿体验就非常不好了,这里分享一个方法。声明欢迎转载,但请保留文章原始出处:

Android使用FFmpeg实现定时录像 1、需求分析在Android下实现定时的录像,首先可以在网络摄像机设置页面实现,在某个时刻录像,但是这种情况福想的视频不是保持在摄像机本地就是上

Android运行时候端口被占用 错误提醒:Theconnectiontoadbisdown,andasevereerrorhasoccured.情况一:尝试以下步骤:运行关闭的Eclipse转到在命令提示符在AndroidSDK平台工具目录键入adbkill-server(E

标签: android intent作用

本文链接地址:https://www.jiuchutong.com/biancheng/379708.html 转载请保留说明!

上一篇:Android学习 各大网络请求库的比较(android需要学什么)

下一篇:【Android】保存Fragment切换状态 FragmentPagerAdapter(android保存文件到本地)

  • 特许权使用费收入
  • 建筑劳务公司的工资计入什么科目
  • 递延收益的核算
  • 外购货物用于什么不得抵扣进项
  • 小规模季超30万,蔬菜还免增值税吗
  • 红字发票认证
  • 自行建造固定资产中的自营工程,在领用工程物资
  • 外购原材料自用
  • 机票报销需要什么单据
  • 背书出去的票据信息在哪里查询
  • 滞纳金账务处理
  • 商业折扣销售会计分录
  • 外聘老师课时费计入什么科目
  • xlsx长数字
  • 应收票据借贷方核算什么内容
  • 往年多交的税能退吗
  • 拍卖费怎么收
  • uniqpp
  • 公积金可以支付二手房首付款吗
  • 工资总额包括哪些福利费
  • 如何做好税收风险管理工作
  • 递归 php
  • 其他业务收入对应的成本
  • mysql.php
  • 权益的定义特征
  • 计提坏账准备和转销坏账准备
  • 水利建设基金申报表哪里
  • 备发工资的会计科目
  • auto.js 逆向
  • 退休返聘人员算临时工吗
  • 周志华《机器学习》第三章课后习题
  • css选择器使用
  • 03-JavaScript基础
  • 报税系统清卡成功状态
  • 应交税费-应交增值税
  • 期初认证相符但未申报抵扣的进项如何消除
  • 为什么计入资本公积
  • 建筑公司遇到的问题
  • mysql事务引擎
  • 远期汇票分为哪几种
  • 终止劳动合同赔偿金最晚多久发放
  • 以权益结算的股份
  • 增值税专用发票丢了怎么补救
  • 对增值税发票开具方面有何要求?
  • 员工高工资
  • 汽车4s店收到保险佣金做账
  • 年末结转步骤
  • 会计差错更正的会计处理方法
  • 企业股权转让收入会计处理
  • 职工福利费支出不超过工资薪金总额的
  • 购买劳务费会计分录
  • 非营利组织相关论文
  • 场地租赁费属于劳务还是服务
  • 生物资产转让增值税
  • 律师咨询费计入什么科目
  • 投资性房地产在建
  • 零星采购多少不需要发票
  • 进项税额准予抵扣是什么意思
  • 会展费会计分录
  • 股息红利等权益性投资收益
  • 服务企业的建账方案
  • sql多表连接查询效率
  • mysql5.7.19下载
  • mysql8.0.23
  • win10微软在哪
  • openfiledialog怎么用
  • bzip2 bunzip2 bzcat参数使用
  • win7如何关闭ie浏览器
  • addObserver和postNotification函数传递函数的区别
  • msvc命令行
  • linux中shell脚本编写
  • Python搭建HTTP服务器和FTP服务器
  • unity shooter
  • jquery方法查询api
  • under code
  • 江苏电子税务局网站官网下载
  • 税务稽查建议书反馈意见
  • 建筑企业税务清算流程图
  • 选矿比怎么算
  • 简述绩效信息的收集原则
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设