位置: 编程技术 - 正文

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应用程序包下载安装)

  • 融资利息进项税如何抵扣
  • 测试费明细
  • 增值税普通发票有什么用
  • 中小企业工会经费怎么算
  • 去年的增值税普票能作废吗?
  • 冲减存货的会计分录
  • 增值税专用发票抵扣联
  • 银行转账结算方式的种类及适用范围
  • 出差旅费补助报销明细表需要发票吗?
  • 偿债基金公司债
  • 往来核算会计的岗位职责和工作内容
  • 长期股权投资出售比例计算
  • 企业法人股东向个人借款能起诉查封公司财产吗
  • 营改增后发票上必须要开具税收分类编码吗?
  • 主营业务收入是营业收入吗
  • 单利和复利的计算区别
  • 外账成本要注意什么
  • 长期待摊费用涉税风险应对
  • 购物预付卡怎么用
  • 增值税小规模纳税人减免增值税
  • 商家不给发票可以报警吗
  • 住房公积金是否全国联网
  • 预提开发成本超过10%部分计算的销售成本转回
  • 平安树的养殖方法和浇水时间
  • soft version
  • 图书装订的工作容易吗
  • php 设计模式
  • 前端lru
  • html img位置
  • 使用的英文
  • 抵债资产怎么入账
  • yolov5最新版
  • yolov5输出参数
  • SpringBoot+Vue实现文件上传下载功能
  • 远程调试时,gdbserver运行在调试机
  • 苹果2021年在中国不能用了吗
  • hashmap教程
  • 哪些计入其他收益与营业外收入
  • java替换集合的元素
  • mysql用户授权信息保存在哪里
  • mongodb4.4安装
  • phpcms建站流程
  • 支付对价的公允价值的处理
  • 股东滥用股东权利
  • 固定资产未登记入账
  • 补办理营业执照需要什么材料
  • 低值易耗品可以报废吗
  • 销售商品返还现金
  • 以前年度损益调整是什么意思
  • 退回货款给客户怎么做会计分录
  • 未使用和未投入使用
  • 租写字楼可以办个体户吗
  • 普通发票的开具是怎样?
  • 成本增加比例怎么算的
  • 商贸企业的销售成本怎么算
  • 房地产一般纳税人可以不预缴增值税吗?
  • sql参数化还是被注入了
  • xp系统删除文件反应很慢
  • windows8怎么用
  • win8系统应用软件颜色不正常怎么办
  • Winpack.exe - Winpack是什么进程
  • win8怎么调亮度调节
  • xp系统纯净版gho
  • linux0.11文件系统
  • win7j
  • win10外置光驱读不出光盘怎么办
  • win7打印机图标显示感叹号
  • 创建自己百度百科
  • extjs4 treepanel动态改变行高度示例
  • bootstrap2
  • JavaScript Math.ceil() 函数使用介绍
  • herd什么意思
  • 微信公众号开发多少钱
  • 批处理压缩
  • node stream(流)有哪些?
  • jquery 表单
  • javascript Keycode对照表
  • 整理Javascript事件响应学习笔记
  • 大连电子税务局app下载
  • 《税收实务》
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设