位置: 编程技术 - 正文

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

  • 税目是什么意思和内容
  • 提现的手续费怎么做账
  • 什么是清算机构的资产
  • 电子承兑凭证
  • 小规模纳税人开票税率
  • 公益募捐什么意思
  • 发票税号不对还能报销吗
  • 当期处置子公司,当期还纳入合报范围嘛
  • 独立核算分公司注销需要清算吗
  • 出租固定资产取得的租金收入属于什么收入
  • 支付保安公司的钱违法吗
  • 预收货款属于资金投入吗
  • 自营建造固定资产的账务处理
  • 小微企业按季度预缴企业所得税
  • 出口用的增值税税率
  • 增值税专用发票几个点
  • 未办理土地使用证违反了什么法律
  • 某企业2016年年末经营资产总额为4000万元
  • 进项税额抵扣不完怎么办
  • 初级备考心得总结
  • 发票勾选保存后不提交了能留到下月抵扣吗?
  • 核销以前年度的其他应付款
  • 开立银行承兑汇票清单怎么盖章
  • harmonyos2.0.0怎么用
  • 土地增值税清算收入如何确定
  • php获取ftp文件目录
  • php curl_multi_init
  • 公司的对公账户
  • jetcar.exe - jetcar是什么进程 有什么作用
  • php

  • 科罗拉多斯普林斯海拔
  • 金融机构拆出资金的最长期限
  • php操作mysql数据库
  • thinkphp框架怎么用
  • 公司设备搬家费会计分录
  • php上传文件限制大小
  • 固定资产改造更新
  • 研发入库的产品销售出库怎样做账
  • 企业研发支出的最佳占比
  • 企业的职工福利费应当按照应付工资总额的14%计提
  • 库存周转率会大于1吗
  • 收到增值税收入423300,款项已存入国库
  • 有趣的 Go HttpClient 超时机制
  • 公司向银行贷款还不上会怎么样
  • 什么情况下计入库存商品
  • 股东每年怎么分红
  • 小规模加工企业加工费会计分录
  • 小规模纳税人结转增值税的账务处理
  • 小企业会计准则适用于哪些企业
  • 租房交付确认书
  • 消费税和购置税系重复征税
  • 企业租车接送员工上下班
  • 行政事业单位拨付给企业的财政补助款用交增值税吗
  • 投资主体将其拥有的货币或产业资本
  • 支付保证金如何做账务处理
  • 食品发票可以报销吗怎么报销
  • 出口免税项目
  • 银行日记账余额与银行对账单不符
  • 损益表格式 最新
  • 安装sqlserver2016步骤
  • freebsd挂载ntfs
  • vc6运行程序
  • 开机越来越慢会不会是硬件的问题
  • elccest.exe是间谍广告程序吗 elccest进程有什么作用
  • win10预览版和正式版区别
  • 安装空调
  • win7系统IE浏览器一点就闪退
  • 批处理 >nul
  • bootstrap应用
  • 置顶pyq会被自己屏蔽的人看到吗
  • Windows10下安装fastdfs
  • javascript中br
  • android网络编程题库
  • python怎么编函数
  • jquery跨域获取页面内容
  • Python线程进程协程
  • 国家税务总局23号文件
  • 公司被分立,应将分立后的单位
  • 河北国家税务局官网站
  • 粮食部门是不是国家机关
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设