位置: 编程技术 - 正文

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

  • 公司全额承担个税怎么申报
  • 税控盘白盘和黑盘一样吗
  • 个人名义开工程发票税率是多少
  • 银行借款的补偿金是什么
  • 资产损失企业所得税扣除
  • 企业持有到期债券的风险
  • 报关单和进口增值税专用缴款书联系
  • 当月销项税大于进项税怎么办
  • 库存现金余额过大的定性
  • 固定资产递延所得税负债
  • 增值税怎么查看
  • 微信交电费怎么退款
  • 收到差额纳税的发票进项税能抵扣吗
  • 广告费发票的税率
  • 水利基金的计税基础是什么
  • 残疾人就业保障金怎么申报
  • 关于个人财产转让的规定
  • 财务报表调整后审计是不也要调整
  • 其他应付款需要做预算会计吗
  • 开了发票一定要确认收入吗
  • 仲裁委判决还能上诉吗
  • 企业在外地的房产怎么办
  • 推广费属于什么税收编码
  • 一寸照片尺寸是几乘几
  • 如何恢复回收站永久删除的文件
  • 我国的社会保险费
  • 软件充值怎么申请退款
  • 怎么重装电脑xp
  • typecho插件开发教程
  • word无法创建工作环境
  • php array数组
  • puppetm
  • nbscheduler是什么程序
  • php中td
  • 进项票留底怎么做分录
  • vue router怎么传值
  • 销售自己使用过的固定资产
  • python爬虫推荐
  • lincom命令
  • 长期股权投资的账务处理
  • 进项税加计抵减最新政策2023
  • 已经提完折旧的房产价值评估
  • 什么情况个税可以扣除
  • 分公司可以独立开票吗
  • 应收账款账龄计提坏账比例
  • 房屋租赁水电费计入什么科目
  • 对外担保产生诉讼费用吗
  • 交易性金融资产的账务处理
  • 收到预收款开具发票如何入账
  • 对方多开票账务会怎么样
  • 研发人员工资计入什么科目
  • 劳务派遣如何做线上业务
  • 疫情防控重点保障企业名单
  • 坏账准备计提的方法和比例
  • 应收账款无法收回说明模板
  • 小规模纳税人发票可以抵扣吗
  • 出口退税过期怎么处理
  • 网吧是个人独资企业还是个体工商户
  • 符合条件的有
  • 公益捐赠仪式流程
  • 股东权益净资产收益率计算公式
  • mysql 生成guid
  • sqlserver查询数据库数据量
  • Win7x64下Mysql5.7.18解压版的安装方法
  • mysql密码总是输入错误
  • windows7升级到windows8.1
  • linux系统基于
  • 000.exe病毒
  • go进程管理
  • win内存占用率过高
  • 添加或删除程序在哪win10
  • node-js
  • ftp下载怎么用
  • python的步骤
  • node网络爬虫
  • python文本处理教程
  • javascript语言基础
  • jquery插件是干什么的
  • 深圳市财政上交广东省吗
  • 建筑企业所交的税项有多少
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设