- 浏览: 1579023 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (289)
- java 语法基础 (51)
- spring (8)
- mvc struct /Ant --build.xml (8)
- SOA (0)
- oracle 9i/10g (23)
- sql server 2000-2005 (3)
- 数据库基础知识 (6)
- 设计模式与软件架构 (10)
- Hibernate 持久化 (9)
- J2SE/J2EE/J2ME/AJAX 技术 (8)
- JSF 技术 (3)
- JAVA 图形化 (0)
- JMS (40)
- Eclipse 3.2 IDE 开发技巧 (13)
- 项目处理方法集合 (2)
- html/jsp/javascript (2)
- Unix/Linux (9)
- j2me/ARM/windriver/嵌入式 (4)
- 电信科学 (8)
- jsp (1)
- c/c++ (1)
- LZW压缩算法(java) (2)
- Android (77)
- 版本管理git/svn (2)
最新评论
-
huihai:
有demo吗?
NamingStrategy实现动态表名映射 -
cangbaotu:
推荐给大家一些有用的爬虫源码:https://github.c ...
网络爬虫(源代码参考) -
tuspark:
除了.classpath文件以外,.project文件也应该了 ...
Eclipse .classpath文件浅谈 -
tuspark:
造成eclipse自动关闭的原因有很多,这里有很多介绍:ecl ...
eclipse 自动关闭 解决方案 -
DEMONU:
网上都是这些,这种文章。。。
ActiveMQ中的消息持久性
Intent应该算是Android中特有的东西。你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料。都指定好后,只要调用startActivity(),Android系统会自动寻找最符合你指定要求的应用程序,并执行该程序。
打开其他APK文件的ACTIVITY
Intent mIntent = new Intent();
ComponentName comp = new ComponentName("com.android.a","com.android.a.AbcActivity" );
mIntent.setComponent(comp);
mIntent.setAction("android.intent.action.MAIN");
startActivity(mIntent);
显示网页:
1. Uri uri = Uri.parse("http://www.google.com");
2. Intent it = new Intent(Intent.ACTION_VIEW,uri);
3. startActivity(it);
显示地图:
1. Uri uri = Uri.parse("geo:38.899533,-77.036476");
2. Intent it = new Intent(Intent.Action_VIEW,uri);
3. startActivity(it);
路径规划:
1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
2. Intent it = new Intent(Intent.ACTION_VIEW,URI);
3. startActivity(it);
拨打电话:
调用拨号程序
1. Uri uri = Uri.parse("tel:xxxxxx");
2. Intent it = new Intent(Intent.ACTION_DIAL, uri);
3. startActivity(it);
1. Uri uri = Uri.parse("tel.xxxxxx");
2. Intent it =new Intent(Intent.ACTION_CALL,uri);
3. 要使用这个必须在配置文件中加入<uses-permission android:name="android.permission.CALL_PHONE" />
发送SMS/MMS
调用发送短信的程序
1. Intent it = new Intent(Intent.ACTION_VIEW);
2. it.putExtra("sms_body", "The SMS text");
3. it.setType("vnd.android-dir/mms-sms");
4. startActivity(it);
发送短信
1. Uri uri = Uri.parse("smsto:0800000123");
2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
3. it.putExtra("sms_body", "The SMS text");
4. startActivity(it);
发送彩信
1. Uri uri = Uri.parse("content://media/external/images/media/23");
2. Intent it = new Intent(Intent.ACTION_SEND);
3. it.putExtra("sms_body", "some text");
4. it.putExtra(Intent.EXTRA_STREAM, uri);
5. it.setType("image/png");
6. startActivity(it);
发送Email
1.
2. Uri uri = Uri.parse("mailto:xxx@abc.com");
3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
4. startActivity(it);
1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");
3. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
4. it.setType("text/plain");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));
1. Intent it=new Intent(Intent.ACTION_SEND);
2. String[] tos={"me@abc.com"};
3. String[] ccs={"you@abc.com"};
4. it.putExtra(Intent.EXTRA_EMAIL, tos);
5. it.putExtra(Intent.EXTRA_CC, ccs);
6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
7. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
8. it.setType("message/rfc822");
9. startActivity(Intent.createChooser(it, "Choose Email Client"));
添加附件
1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
3. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
4. sendIntent.setType("audio/mp3");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));
播放多媒体
//方法1.
Uri uri = Uri.parse("file:///sdcard/song.mp3");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
// it.addFlags(it.FLAG_ACTIVITY_NEW_TASK);//非必须选项
it.setDataAndType(uri, "audio/mp3");
context.startActivity(it);
//方法2.
1.
2. Intent it = new Intent(Intent.ACTION_VIEW);
3. Uri uri = Uri.parse("file:///sdcard/song.mp3");
4. it.setDataAndType(uri, "audio/mp3");
5. startActivity(it);
//方法3. 启动一个播放器并播放一个系统声音
1. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
2. Intent it = new Intent(Intent.ACTION_VIEW, uri);
3. startActivity(it);
Uninstall 程序
1. Uri uri = Uri.fromParts("package", strPackageName, null);
2. Intent it = new Intent(Intent.ACTION_DELETE, uri);
3. startActivity(it);
uninstall apk
1. Uri uninstallUri = Uri.fromParts("package", "xxx", null);
2.
3. returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
install apk
1. Uri installUri = Uri.fromParts("package", "xxx", null);
2.
3. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
play audio
1. Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3");
2.
3. returnIt = new Intent(Intent.ACTION_VIEW, playUri);
哈,原来你还没贴完,我再加个:
1. //发送附件
2. Intent it = new Intent(Intent.ACTION_SEND);
3. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
4. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3");
5. sendIntent.setType("audio/mp3");
6. startActivity(Intent.createChooser(it, "Choose Email Client"));
market相关
再来一个market相关的:
market相关
1. //搜索应用
2. Uri uri = Uri.parse("market://search?q=pname:pkg_name");
3. Intent it = new Intent(Intent.ACTION_VIEW, uri);
4. startActivity(it);
5. //where pkg_name is the full package path for an application
6.
7. //显示指定应用的详细页面(这个好像不支持了,找不到app_id)
8. Uri uri = Uri.parse("market://details?id=app_id");
9. Intent it = new Intent(Intent.ACTION_VIEW, uri);
10. startActivity(it);
11. //where app_id is the application ID, find the ID
12. //by clicking on your application on Market home
13. //page, and notice the ID from the address bar
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/kome2000/archive/2009/10/20/4704308.aspx
发表评论
-
APN(default、mms、supl、dun、hipri接入点类型的区别)
2013-10-10 19:31 45606设置APN上网时,大家可能经常遇到这个问题:为什么有时要填写 ... -
AMR音频编码器概述及文件格式分析
2013-10-10 19:29 3915全称Adaptive Multi-Rate,自适应多速率编码 ... -
pad 强制加载 Hdpi资源 (2.3 dpi < 240)
2012-07-16 16:47 0pad 强制加载 Hdpi资源 (2.3 dpi < ... -
android 设计模式-享元模式
2011-12-16 23:01 2152享元(FlyWeight)模式,原意是“轻量级”模式,它用来解 ... -
statusbar 2.3
2011-11-08 16:04 1245以前我的文章分析过Stat ... -
android 输入法默认设置
2011-07-07 14:00 7148设置默认输入法 在 frameworks\base\co ... -
Android Media Scanner Process
2011-06-06 22:58 3356下面是系统图 Medi ... -
handler与多线程消息处理
2011-06-04 13:42 8244在Android下面也有多线程的概念,在C/C++中,子线程可 ... -
android light
2011-03-24 16:15 3382背光设置是在:设置->声音和显示->亮度,通过进度 ... -
PowerManagerService sensor
2011-03-22 20:06 2637默认分类 2010-12-24 14:34:55 阅读144 ... -
android 单例
2011-02-15 09:26 41901. Framework层的代码: A ... -
Android 开发之 Services 服务
2010-11-02 18:21 4195Service Service ... -
深入学习android之AlarmManager
2010-11-01 16:50 34684对应AlarmManage有一个Alarm ... -
eclipse+android+ddms+adt
2010-09-14 10:30 8393用eclipse + ADT作为android ... -
Menus
2010-09-05 19:01 1760Android Menus 文章分类:移动开发 1.O ... -
Android开机自启动应用开发
2010-08-28 10:07 4557目前需要开发一个开机自启动的GTD应用程序来提醒用户的 ... -
Android2.1_Launcher学习笔记
2010-08-11 13:40 3808文章分类:移动开发 好么,2.0的源码没看几天,2.1的 ... -
Browsing Android Source in Eclipse
2010-08-09 16:00 3391Google’s Android SDK includes ... -
android 编译
2010-08-07 16:31 24921 我的系统是Ubuntu 8.04 * 2 系统上 ... -
Ubuntu linux 右键添加"以管理员身份打开","在终端中打开"
2010-08-02 15:04 4554Ubuntu linux 右键添加"以管理员身份打开 ...
相关推荐
Android IntAndroid Intent的几种用法全面总结ent的几种用法全面Android Intent的几种用法全面总结总结
intent的几种常用用法.pdf
intent的常用方法 Intent在Android中的几种用法 文章分类:综合技术
该资源主要包含了Android中Intent中如何传值的几种方法: 1:基本数据类型,包含了Java八种基本数据类型和CharSequece文本 2:八种数据类新对应数组和CharSequece文本数组 3:Bundle传值 4:ArrayList集合 5:...
4种最常用的Intent传递方式,这4种方式如下: 1、通过Intent传递数据 2、通过静态变量传递数据 3、通过剪切板传递数据 4、通过全局变量传递数据
android常用Intent汇总,移动开发
详细地描述了Activty间使用Intent传递数据并返回结果的方式方法。
三种应用程序基本组件——activity, service和broadcast receiver——是使用称为intent的消息来激活的。Intent消息传递是一种组件间运行时绑定的机制. intent是Intent对象, 它包含了需要做的操作的描述, 或者, ...
议题归纳了几种常见的Intent注入类型,如何用工具去自动挖掘这些漏洞,并演示了几个在安卓框架层、系统级APP以及浏览器中发现的Intent注入漏洞。 目录 Intent注入的概念 Intent转换与复制 Action/Component/Data注入...
在sendBroadcast,startActivity时,我们会用到Intent。 Intent可以携带一些数据,比如基本类型数据int、Boolean,或是String,或是序列化对象,Parcelable与Serializable。 Intent传递数据时,如果数据太大,可能...
在activity中有关intent的三种用法,最简单实用。
IntentIntent-Filter思维导图
intent startactivityforresult setResult intent
Intent的各种使用方法!查看指定联系人,显示网页,显示地图等
android Intent例子源码android Intent例子源码android Intent例子源码android Intent例子源码android Intent例子源码android Intent例子源码
下面列出几种Intent的用法显示网页: 代码如下:Uri uri = Uri.parse(“http://www.google.com”);Intent it = new Intent(Intent.ACTION_VIEW,uri);startActivity(it);显示地图: 代码如下:Uri uri
Android 常用的Intent的URI及示例.txt