位置: 编程技术 - 正文

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保存文件到本地)

  • 个税申诉已受理怎么撤销
  • 如何判断销售额含税还是不含税
  • 增值税小规模纳税人申报表填表说明
  • 车辆出现质量问题
  • 税收滞纳金调增填哪张表
  • 实收资本实务处理办法
  • 实际发放股票股利是什么意思
  • 水电气费用属于固定成本
  • 签合同前的费用由谁承担
  • 地税补缴社保
  • 银行打出的明细清单怎么看不懂
  • 企业合并股份比例
  • 甲方代付材料费合法吗
  • 注册地址与实际办公地址不一致怎么办
  • 建筑业咨询费有哪些
  • 银行汇票分几种
  • 现金流量表年报期末现金余额
  • 银行存款收款凭证
  • 缴纳印花税需要计提吗?
  • 如果公司没有报税
  • 厂房进项抵扣
  • 电梯安装简易征收的优点
  • 自然人股东转让股权如何避税
  • 核定征收分几种
  • 在企业走账扣的税点钱如何做账?
  • 关联企业之间的咨询费
  • 发票有问题找谁
  • 工会上缴40%的经费法律依据
  • 现金日记账期初余额怎么登账
  • 财政拨款事业单位和全额事业单位
  • 猫光纤信号灯闪红
  • 然后用u盘重装系统
  • Win10待机唤醒后白屏怎么办
  • 经营租入固定资产的租赁费计入
  • 收到现金股利或债券利息时会计分录
  • php str函数
  • 增值税纳税申报表在哪里打印
  • 唱吧地图
  • 广告费与业务宣传费范围
  • redux入门教程
  • PHP magento后台无法登录问题解决方法
  • upf命令
  • 投资入股的会计处理
  • js继承的几种方式 各有什么优缺点
  • 应交所得税的科目是什么
  • 支付宝对公账户怎么转账
  • 个人所得税法实施细则2023
  • 当月开出的销项票一定要当月抵扣吗
  • 用于研发的材料后期销售了应该怎么账务处理
  • 长期待摊费用当月发生当月要摊吗
  • js回调函数如何返回值
  • 公司购买led屏幕做到什么费用
  • 商品流通企业的基本要素
  • 零售行业bi
  • 建筑企业跨地区经营企业所得税
  • SQLserver2008数据库Excel数据导入语句
  • 用友t6操作流程
  • 使用积分换取物的软件
  • 个人取得全年一次性奖金征税规定
  • 临时建筑房
  • 免费样品要交税么
  • 还账准备计提方法
  • 广告制作需要交文化事业建设税
  • 个人经纪代理服务
  • 赠送购物券的会计处理
  • phpmyadmin配置文件
  • mysql5.7.27安装
  • 让Windows Server 2008设备驱动安装图文教程
  • openstack 创建云主机,计算节点磁盘不足
  • 为什么开机会提示无信号
  • 怎么用苹果电脑打印照片
  • 怎样打开进程管理器功能
  • ie的进程
  • linux如何查看磁盘信息
  • linux使用rar命令压缩文件
  • ie10变成ie8
  • 32/64位Win10预览版11102(中英日韩等)多国语言包官方iso镜像下载大全
  • 基于javascript的毕业设计
  • perl遍历哈希
  • 深圳国税服务
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设