- 浏览: 398979 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
ysn003:
这样用就好啦!!!<Button ...
Android学习 之 ColorStateList按钮文字变色 -
ysn003:
Android学习 之 ColorStateList按钮文字变色 -
vitoliao:
楼主你好,如果你的代码需要实现的是回显功能,需要在MainCl ...
Java学习 之 Socket(实现简易的C/S聊天室) -
xinqiqi123:
在item布局中要是引用到自定的东西,item就会显示不全
Android学习 之 问题&解答 ScrollView中嵌套ListView时显示不全的简便解决方案 -
CTXsamCTX:
很好,学习了。
Android 图形用户界面 之 绘图(一)
从别人那里抠的,代码有点乱,仅供自己参考,需要的自己整理下吧,或直接链接到作者的博客地址:
http://dev.10086.cn/cmdn/wiki/index.php?doc-view-7305.html 转载请说明
C/C++代码
- //调用浏览器
- Uri uri = Uri.parse("");
- Intent it = new Intent(Intent.ACTION_VIEW,uri);
- startActivity(it);
复制到剪贴板 C/C++代码
- //显示某个坐标在地图上
- Uri uri = Uri.parse("geo:38.899533,-77.036476");
- Intent it = new Intent(Intent.Action_VIEW,uri);
- startActivity(it);
复制到剪贴板 C/C++代码
- //显示路径
- Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
- Intent it = new Intent(Intent.ACTION_VIEW,URI);
- startActivity(it);
复制到剪贴板 C/C++代码
- //拨打电话
- Uri uri = Uri.parse("tel:10086");
- Intent it = new Intent(Intent.ACTION_DIAL, uri);
- startActivity(it);
- Uri uri = Uri.parse("tel.10086");
- Intent it =new Intent(Intent.ACTION_CALL,uri);
需要添加 <uses-permission id="Android.permission.CALL_PHONE" /> 这个权限到androidmanifest.xml
复制到剪贴板 C/C++代码
- //发送短信或彩信
- Intent it = new Intent(Intent.ACTION_VIEW);
- it.putExtra("sms_body", "The SMS text");
- it.setType("vnd.android-dir/mms-sms");
- startActivity(it);
复制到剪贴板 C/C++代码
- //发送短信
- Uri uri = Uri.parse("smsto:10086");
- Intent it = new Intent(Intent.ACTION_SENDTO, uri);
- it.putExtra("sms_body", "cwj");
- startActivity(it);
复制到剪贴板 C/C++代码
- //发送彩信
- Uri uri = Uri.parse("content://media/external/images/media/23");
- Intent it = new Intent(Intent.ACTION_SEND);
- it.putExtra("sms_body", "some text");
- it.putExtra(Intent.EXTRA_STREAM, uri);
- it.setType("image/png");
- startActivity(it);
复制到剪贴板 C/C++代码
- //发送邮件
- Uri uri = Uri.parse("mailto:android123@163.com");
- Intent it = new Intent(Intent.ACTION_SENDTO, uri);
- startActivity(it);
- Intent it = new Intent(Intent.ACTION_SEND);
- it.putExtra(Intent.EXTRA_EMAIL, android123@163.com);
- it.putExtra(Intent.EXTRA_TEXT, "The email body text");
- it.setType("text/plain");
- startActivity(Intent.createChooser(it, "Choose Email Client"));
- Intent it=new Intent(Intent.ACTION_SEND);
- String[] tos={"me@abc.com"};
- String[] ccs={"you@abc.com"};
- it.putExtra(Intent.EXTRA_EMAIL, tos);
- it.putExtra(Intent.EXTRA_CC, ccs);
- it.putExtra(Intent.EXTRA_TEXT, "The email body text");
- it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
- it.setType("message/rfc822");
- startActivity(Intent.createChooser(it, "Choose Email Client"));
复制到剪贴板 C/C++代码
- //播放媒体文件
- Intent it = new Intent(Intent.ACTION_VIEW);
- Uri uri = Uri.parse("file:///sdcard/cwj.mp3");
- it.setDataAndType(uri, "audio/mp3");
- startActivity(it);
- Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
- Intent it = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(it);
复制到剪贴板 C/C++代码
- //卸载APK
- Uri uri = Uri.fromParts("package", strPackageName, null);
- Intent it = new Intent(Intent.ACTION_DELETE, uri);
- startActivity(it);
- //卸载apk 2
- Uri uninstallUri = Uri.fromParts("package", "xxx", null);
- returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
- //安装APK
- Uri installUri = Uri.fromParts("package", "xxx", null);
- returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
复制到剪贴板 C/C++代码
- //播放音乐
- Uri playUri = Uri.parse("file:///sdcard/download/sth.mp3");
- returnIt = new Intent(Intent.ACTION_VIEW, playUri);
复制到剪贴板 C/C++代码
- //发送附近
- Intent it = new Intent(Intent.ACTION_SEND);
- it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
- it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/cwj.mp3");
- sendIntent.setType("audio/mp3");
- startActivity(Intent.createChooser(it, "Choose Email Client"));
复制到剪贴板 C/C++代码
- //market上某个应用信,pkg_name就是应用的packageName
- Uri uri = Uri.parse("market://search?q=pname:pkg_name");
- Intent it = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(it);
复制到剪贴板 C/C++代码
- //market上某个应用信息,app_id可以通过www网站看下
- Uri uri = Uri.parse("market://details?id=app_id");
- Intent it = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(it);
复制到剪贴板 C/C++代码
- //调用搜索
- Intent intent = new Intent();
- intent.setAction(Intent.ACTION_WEB_SEARCH);
- intent.putExtra(SearchManager.QUERY,"android123")
- startActivity(intent);
发表评论
-
Android 学习 之 使用ActivityGroup调用对应Activity的菜单
2011-12-23 17:34 2526代码很简单,直接贴在这里了。 在使用ActivityGrou ... -
Android 学习 之 TextView结合SpannableString
2011-12-22 12:02 5391protected void onCreate(Bundle ... -
Android 学习 之 图形绘制篇 获取要绘制的文字的宽度/长度
2011-11-29 15:43 7327转自:http://www.cnblogs.com/Tiger ... -
Android 学习 之 键盘问题
2011-10-12 12:00 44571.隐藏键盘 一般情况下,都是在点击某个View的时候 ... -
Android 学习 之 SD卡相关
2011-08-19 15:42 12601.获取SD的路径字符串 public static Str ... -
Android 学习 之 关于应用程序的自适应问题(一)
2011-08-16 12:18 1565转自:http://venus-chen.iteye.com/ ... -
Android 学习 之 资源文件 布局中ID的引用
2011-08-16 11:30 5931转自:http://tiantian0521.blog.163 ... -
Android 学习 之 关闭应用程序的方法
2011-08-10 11:46 1359package com.close; import jav ... -
Android 学习 之 资源文件 动态修改strings.xml中的字符资源
2011-08-10 11:25 6441转自:http://www.cnblogs.com/cools ... -
Android学习 之 动态切换全屏和非全屏模式
2011-06-02 10:03 4349直接贴出代码: package com.screen; ... -
Android学习 之 常见知识点记录
2011-06-01 20:35 1811也是转的,呜呜,人家写的好好,有记录的习惯,值得学习,转载请说 ... -
Android学习 之 获取可视区域的Rect对象(顺带获取状态栏和标题栏高度的方法)
2011-06-01 11:31 10780这个有什么用捏,这 ... -
Android 基本控件 之 Dialog(二)Dialog主题的Activity
2011-06-01 10:10 2637转自:http://www.cnblogs.com/xi ... -
Android 基本控件 之 SeekBar(一) 个性你的视图
2011-05-31 16:34 12079系统自带的SeekBar组件 ... -
Android 系统设置 之 保持手机屏幕常亮的方法
2011-05-25 18:13 9739方法一: 在Activity的onCreate()中: ... -
Android 图形用户界面 之 绘图(二) Paint类 主要方法介绍
2011-05-25 18:09 9207摘自《Ophone应用开发权威指南》: /** * P ... -
Android 图形用户界面 之 绘图(一)
2011-05-25 17:59 30591直接贴上代码: BasicViewDraw.java ... -
【转】Android 画图 之 Matrix(三)
2011-05-24 19:04 1603原文地址:http://developer.51cto.com ... -
【转】Android 画图 之 Matrix(二)
2011-05-24 18:51 1365原文地址:http://chroya.iteye.com/ ... -
【转】Android 画图 之 Matrix(一)
2011-05-24 17:44 1349原文地址: http://chroya.iteye.com/ ...
相关推荐
android 利用intent调用activity 简明精炼的例子 传递数据,并且有返回值
Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面.
android调用系统邮件组件 Intent匹配流程 csdn博客地址
Android 用Intent调用系统中经常被用到的组件 android用于打开各种文件的intent
Android7.0 Intent打开文件管理器 获取文件真实路径。虽然网上很多demo,但是没有一个能够兼容所有Android机的,去网上学习了然后自己亲测过手机分别有Android7.0/6.0/4.3个版本。
Intent在Android应用开发中,占有很大的分量,关于Intent在Android中的作用在网络上已经有很多资料了,这里不再累赘,本人喜欢直来直去。在网上看到很多关于Intent的资料,说那么多,你也许还是一头雾水,到底如何...
本文档记载了常用的几个系统组件的启动关键代码 action 和category data的值
Android_Intent详解
主要介绍了Android Intent调用 Uri的方法总结的相关资料,这里整理了Android Intent 调用Uri的常用方法,需要的朋友可以参考下
android 系统调用WPS打开word excel ppt pdf 等,将代码类移入的你项目,有对6.0 7.0及以上系统做文件读取方法
本文实例讲述了Android学习之Intent中显示意图和隐式意图的用法。分享给大家供大家参考,具体如下: Intent(意图)主要是解决Android应用的各项组件之间的通讯。 Intent负责对应用中一次操作的动作、动作涉及数据、...
主要介绍了Android 通过Intent调用系统拍照程序出现图片太小的问题解决办法的相关资料,需要的朋友可以参考下
Intent提供了一种通用的消息系统,它允许在你的应用程序见传递Intent来执行动作和产生事件,使用Intent可以激活Android应用的三种类型的核心组件:活动Activity、服务Service、广播接受者Broadcast。 Intent又分为...
使用Intent调用系统的相机服务 并把图片保存起来 显示到ImageView上 也可以打开本地的图片 欢迎下载 你绝对不吃亏
android项目之aidl跨进程调用举例Demo,开发aidl跨进程调用,主要分以下步骤: 1. 创建.aidl文件-该文件(YourInterface.aidl)定义了客户端可用的方法和数据的接口。 2. 在makefile文件中加入.aidl文件-(Eclipse...
Intent是Android中用来调用其它组件的类,通过Intent,我们可以非常方便的调用Activity,Broadcast Receiver和Service。 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse...
Intent 与 Intent Filters 实现外部调用
cordova调用安卓原生activity插件 使用简介 JS端使用方式 //sendData表示要从js端发送到原生activity的数据,需用json对象传输 var sendData = { id:10001, name:"Simon", age:28 }; window.cordova.plugins....
Android的Intent方式拍照源代码,具体文章请参考:http://blog.csdn.net/gobitan/article/details/9158825