位置: 编程技术 - 正文

Android开发:使用Intent打开电话、短信、邮箱、本地文件等系统应用程序整理大全(Android开发使用的官方IDE是)

编辑:rootadmin

推荐整理分享Android开发:使用Intent打开电话、短信、邮箱、本地文件等系统应用程序整理大全(Android开发使用的官方IDE是),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:android开发一般使用的语言是,Android开发使用别人打包好的应用,Android开发使用的官方IDE是____,Android开发使用的主要编程语言是什么,Android开发使用别人打包好的应用,Android开发使用的官方IDE是,Android开发使用的官方IDE是,Android开发使用的技术有哪些,内容如对您有帮助,希望把文章链接给更多的朋友!

1. Intent open a picture file public:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Uri uri = Uri.fromFile(new File("/mnt/sdcard/images/.jpg")); intent.setDataAndType (uri, "image/*"); this.startActivity(intent);

2. Intent to open a PDF file:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Uri uri = Uri.fromFile(new File(" intent.setDataAndType (uri, "application/pdf"); this.startActivity(intent);

3. Intent to open a text file:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); if (paramBoolean) { Uri uri1 = Uri.parse (param); intent.setDataAndType (URI1, "text/plain"); } else { Uri uri = Uri.fromFile(new File("/mnt/sdcard/hello.txt")); intent.setDataAndType (URI2, "text/plain"); } this.startActivity(intent);

4. Intent to open the audio file:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra ("oneshot", 0); intent.putExtra ("configchange", 0); Uri uri = Uri.fromFile(new File("/mnt/sdcard/ren.mp3")); intent.setDataAndType (uri, "audio/*"); this.startActivity(intent);

5. Intent to open the video file:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra ("oneshot", 0); intent.putExtra ("configchange", 0); Uri uri = Uri.fromFile(new File("/mnt/sdcard/ice.avi")); intent.setDataAndType (uri, "video/*"); this.startActivity(intent);

6. Intent to open the CHM file:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Uri uri = Uri.fromFile(new File("/mnt/sdcard/ice.chm")); intent.setDataAndType (uri, "application / x-chm"); this.startActivity(intent);

7. Intent to open a Word document:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Uri uri = Uri.fromFile(new File("/system/etc/help.doc")); intent.setDataAndType(uri, "application/msword"); this.startActivity(intent);

8. Android Excel intent:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Uri uri = Uri.fromFile(new File("/mnt/sdcard/Book1.xls")); intent.setDataAndType (uri, "application/vnd.ms-excel"); this.startActivity(intent);

9. Intent to open the PPT file:

Java代码 Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Uri uri = Uri.fromFile(new File("/mnt/sdcard/download/Android_PPT.ppt")); intent.setDataAndType (uri, "application/vnd.ms-powerpoint"); this.startActivity(intent);

. Display Html page::

Java代码 Uri uri = Uri.parse (" Intent intent = new Intent (Intent.ACTION_VIEW, uri); this.startActivity(intent);

. Show map:

Java代码 Uri uri = Uri.parse ("geo: ., -."); Intent intent = new Intent (Intent.Action_VIEW, uri); this.startActivity(intent);

. Call the dialer:

Java代码 Uri uri = Uri.parse ("tel: xxxxxx"); Intent intent = new Intent (Intent.ACTION_DIAL, uri); this.startActivity(intent);

. Call :

Java代码 Uri uri = Uri.parse ("tel: xxxxxx"); Intent it = new Intent (Intent.ACTION_CALL, uri); this.startActivity(intent); /*permission: <uses-permission id="android.permission.CALL_PHONE"> </uses-permission> */

. Call to send text messages of the program :

Java代码 Intent intent = new Intent (Intent.ACTION_VIEW); intent.putExtra("sms_body", "The SMS text"); intent.setType("vnd.android-dir/mms-sms"); this.startActivity(intent); Android开发:使用Intent打开电话、短信、邮箱、本地文件等系统应用程序整理大全(Android开发使用的官方IDE是)

. Send SMS :

Java代码 Uri uri = Uri.parse("smsto:"); Intent intent = new Intent(Intent.ACTION_SENDTO, uri); intent.putExtra("sms_body", "The SMS text"); this.startActivity(intent);

. Send MMS :

Java代码 Uri uri = Uri.parse(" Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra("sms_body", "some text"); intent.putExtra(Intent.EXTRA_STREAM, uri); intent.setType("image/png"); this.startActivity(intent);

. Send an Email :

Java代码 Uri uri = Uri.parse ("mailto: xxx@abc.com"); Intent intent = new Intent (Intent.ACTION_SENDTO, uri); this.startActivity(intent);

. Send an Email with body :

Java代码 Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_EMAIL,"me@abc.com"); intent.putExtra(Intent.EXTRA_TEXT,"The email body text"); intent.setType ("text/plain"); this.startActivity( Intent.createChooser(intent, "Choose Email Client"));

. Send an Email with body,to,cc :

Java代码 Intent intent = new Intent(Intent.ACTION_SEND); String [] tos ={"me@abc.com"}; String [] ccs ={"you@abc.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"); this.startActivity( Intent.createChooser(intent, "Choose Email Client"));

. Send an Email with attachments :

Java代码 Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_SUBJECT,"The email subject text"); intent.putExtra(Intent.EXTRA_STREAM,"file :///sdcard/mysong.mp3"); sendIntent.setType("audio/mp3"); this.startActivity( Intent.createChooser(intent,"Choose Email Client"));

. Uninstall the program :

Java代码 Uri uri = Uri.fromParts ("package", strPackageName, null); Intent intent = new Intent (Intent.ACTION_DELETE, uri); this.startActivity( Intent.createChooser(intent,"Choose Email Client"));

. Install the apk :

Java代码 Uri installUri = Uri.fromParts("package", "xxx", null); returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri); this.startActivity(returnIt);

. Search applications :

Java代码 Uri uri = Uri.parse(" Intent intent = new Intent(Intent.ACTION_VIEW, uri); this.startActivity(intent); //Where pkg_name is the full package path for an application

. Google Search Launch Web Browser :

Java代码 Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); String term = "Android"; intent.putExtra(SearchManager.QUERY, term); activity.startActivity(intent);

. Send text using Intent (to messaging apps) :

Java代码 Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); String msgBody = "This is message"; Intent intent = new Intent(android.content.Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "message subject"); intent.putExtra(android.content.Intent.EXTRA_TEXT, msgBody); activity.startActivity(Intent.createChooser(intent, getResources(). getString(R.string.share_by_using)));

. Create Shortcut on "Home Screen" :

Java代码 Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); Intent toPrint = new Intent(this, anCreateshutcut.class); Intent addShortcut = new Intent ("com.android.launcher.action.INSTALL_SHORTCUT"); addShortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Shutcutname"); addShortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, toPrint); addShortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this, R.drawable.icon)); Manifest file: <intent-filter> <action android:name="android.intent.action.CREATE_SHORTCUT"> <category android:name="android.intent.category.LAUNCHER"> </category></action></intent-filter> <uses-permission android:name="com.android.launcher. permission.INSTALL_SHORTCUT"> </uses-permission>

Android应用程序私有目录下文件操作总结 每一个Android程序都有一个特有的,只能由本程序自己访问的私有目录,这个目录一般位于/data/data/PackageName/目录下。所有应用程序私有目录中保存的文

Android CTS测试Fail项修改总结(四) Android5.1上的测试1、android.security.cts.SELinuxDomainTest#testInitDomainfail打印的logjunit.framework.AssertionFailedError:Expected1processinSELinuxdomainu:r:init:s0Found[pid:1proctitle:/init

Android 软件开发之如何使用Eclipse Debug调试程序详解 1.在程序中添加一个断点如果所示:在Eclipse中添加了一个程序断点在Eclipse中一共有三种添加断点的方法第一种:在红框区域右键出现菜单后点击第一项T

标签: Android开发使用的官方IDE是

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

上一篇:Android 通过图库选择图片提示找不到路径 open failed: EROFS (Read-only file system)(安卓获取图片路径)

下一篇:Android应用程序私有目录下文件操作总结(android应用程序包下载安装)

  • 财税实务与核算会计的区别在哪里?
  • 印花税核定征收文件
  • 主营业务收入科目按其所反映的经济内容不同
  • 筹建期间业务招待费的财税处理规定
  • 增值税纳税申报时间
  • 咨询服务费预收率怎么算
  • 低于5000是什么意思
  • 会计大写数字金额书写规则
  • 低值易耗品费用包括哪些
  • 已纳消费税税款允许扣除的是
  • 已结转的凭证可以取消结转吗
  • 固定资产领用流程图
  • 企业所得税营业税金及附加
  • 单位车辆卖给个人怎么开票
  • 试分析营改增的重大意义
  • 营改增以后小规模纳税人如何纳税
  • 企事业承包承租方缴纳的管理费税费
  • 航天开票系统清单流程
  • 增值税的附加税有哪些,税费多少
  • 分期收款方式怎么算消费税
  • 存货质押融资的银行
  • 税务局返还的个税手续费需要缴纳增值税吗
  • 无法删除文件提示怎么办
  • win7如何设置高级网卡功能适合玩网络游戏
  • php中strrev
  • 未分配利润冲减其他应付款分录
  • 贷款损失会计处理
  • .exe是什么文件
  • php imagettftext()函数
  • 新事业单位会计准则
  • vue的actions
  • 程序员的表白情书
  • framework怎么查看
  • SpringBoot+Vue实现文件上传下载功能
  • 小规模纳税人房产税优惠政策2023
  • 应付职工薪酬多栏式
  • 购物赠品的相关法律
  • 税控维护费可以抵企业所得税吗
  • 员工出差过程中意外死亡算工伤吗
  • 公对公的税票是怎么个流程
  • 员工在其他公司担任股东,违法吗
  • access使用查询向导创建查询
  • 人力资源服务的发票明细
  • 工会经费按每月
  • 资产减值损失应在计算()时扣除
  • 固定资产升级账务处理
  • 商业折扣影响销售成本吗
  • 水电费计提是什么意思
  • 工会经费计入什么项目流量表
  • 增值税申报表里期初未缴税额是什么意思
  • 固定资产属于净资产指的是什么
  • 纳税人在工作
  • 税务局收款收据
  • 员工伤残补助会计分录
  • 会计调账情况模板
  • 安装mysql失败原因
  • sqlserver高级语法
  • mysql+php
  • windows找不到文件请确定文件名是否正确
  • Windows Server 2003环境更改Boot.ini文件
  • linux切换到home文件夹
  • freebsd ifconfig
  • Winaw32.exe - Winaw32是什么进程
  • centos最小化安装配置网络
  • scanserver.exe - scanserver是什么进程 有什么用
  • 电脑为什么会黑屏
  • win8和win10怎么共享文件
  • vsftpd 配置限制用户目录
  • 下载的mt4安装成了mt5
  • cocos2dx运行原理
  • opengl详解
  • shell脚本数字运算
  • Setver、Share、Subst命令的使用方法
  • jquery 图片预览
  • 批处理文件实例
  • 安卓开源好处
  • jquery 滑动显示
  • 广东省地方税务局发票查询
  • 广东省电子税务局申报缴税操作指引
  • 出售固定资产税收怎么算
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设