位置: 编程技术 - 正文

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

  • 房产税从价计征如何算
  • 委托加工物资的会计科目
  • 预收款增值税纳税义务发生时间与确认收入时间
  • 银行日记账写错了怎么改
  • 工资3700扣多少社保钱
  • 建筑工人的工资应该怎样支付
  • 甲方代扣水电费怎么做账
  • 商业承兑汇票贴现手续费是多少
  • 公司收的保证金可以打入私人账户吗
  • 免息分期怎么还款
  • 出口退税的办理影响出口吗
  • 增值税发票如何读入金税盘
  • 工资表中有哪些项目
  • 印花税是当月交还是次月交
  • 公司车辆可以一年一检吗
  • 什么人可以领购房补贴怎么领取
  • 施工现场应建立什么
  • 盘点固定资产
  • 4s店贷款服务费是什么
  • 汇算清缴工资调增,账务要处理吗
  • 公司付股东退股怎么处理
  • 在win7中创建快捷方式可以创建什么
  • 水土保持补偿费是一次性征收吗
  • bootcamp怎么直接安装
  • 银行多收的开户费怎么办
  • 怎么增加c盘空间容量
  • 人际交往的作用是什么
  • 期间损益的科目
  • PHP:Memcached::quit()的用法_Memcached类
  • 知乎如何更改名字
  • PHP:pg_send_query()的用法_PostgreSQL函数
  • win10磁盘碎片整理打不开
  • bds.exe
  • 长期借款科目核算方法
  • 实际借款成本率
  • 资产负债表的资产方能够提供的信息包括
  • 蜜蜂皇vs
  • idea连接sqlserver数据库教程
  • html零基础入门教程
  • 层层剖析的近义词
  • php微信公众号 全站模板
  • 小规模工程服务开票几个点
  • phpcms模板制作教程
  • 可转债可以不卖吗
  • 生成100个[30-99]之内的随机数
  • 可明确区分的商品什么意思
  • 间接人工费用计入什么科目
  • 管理费用如何冲减
  • 不合格产品会计处理
  • 应收款钱已收回会计分录
  • 客户要赔偿怎么回复
  • 年初余额和期末余额对不上怎么办
  • 固定资产清理如何计算
  • 应交税费期初有余额吗
  • 为取得交易性金融资产支付的手续费
  • 加计抵减10%政策适用范围
  • 股权变更需要交哪些税
  • sql语句数字转化为文字
  • xp系统怎么取消开机登录界面
  • Vista 目前的窘境5大原因分析
  • stdin命令
  • linux/unix
  • ctl.start
  • xp显示文件后缀怎么设置
  • linux系统中在给定文件中查找与设定条件
  • Windows8 PrintScreen屏幕截图如何保存到桌面上
  • linux中安装软件可使用哪些方式
  • dos 批处理
  • linux rsync同步命令(值得收藏)
  • unity3d教学视频
  • jquery easyui插件
  • 半透明图层怎么制作
  • 基于mvc的项目实例
  • javascript中checkbox使用方法实例演示
  • 中国税务精神内容英文
  • 净化水服务税务分类
  • 南京税务局 局长
  • 全国征兵网官网报名
  • 税务规范性文件制定管理办法
  • 18款凯美瑞中控屏
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设