- 浏览: 352283 次
- 性别:
- 来自: 北京
最新评论
-
sxchao2008:
心雨心 写道你说的不好用是?你好,在静默卸载系统级别app的时 ...
静默卸载系统软件和第三方软件 -
zhao1111:
请问楼主哪里提供地震的xml文件啊
android解析xml文件 Android DOM解析XML之全球实时地震信息列表 -
yuanmouren1hao:
java字节流(读写文件) -
haiyangzhy:
很好。
ScrollView中嵌入ListView办法 -
gisdaniel:
[/url][url][fla ...
Android中的XML解析-DOM的使用与开发技巧
android 中intent是经常要用到的。
不管是页面牵转,还是传递数据,或是调用外部程序,系统功能都要用到intent。
在做了一些intent的例子之后,整理了一下intent,希望对大家有用。
由于intent内容太多,不可能真的写全,难免会有遗落,以后我会随时更新。如果你们有疑问或新的intent内容,希望交流。
★intent大全:
1.从google搜索内容
Intent intent = new Intent();
intent.setAction(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY,"searchString")
startActivity(intent);
2.浏览网页
Uri uri = Uri.parse("http://www.google.com");
Intent it = new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);
3.显示地图
Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);
4.路径规划
Uri uri = Uri.parse("http://maps.google.com/maps?f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
Intent it = new Intent(Intent.ACTION_VIEW,URI);
startActivity(it);
5.拨打电话
Uri uri = Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL, uri);
startActivity(it);
6.调用发短信的程序
Intent it = new Intent(Intent.ACTION_VIEW);
it.putExtra("sms_body", "The SMS text");
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
7.发送短信
Uri uri = Uri.parse("smsto:0800000123");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", "The SMS text");
startActivity(it);
String body="this is sms demo";
Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number, null));
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);
startActivity(mmsintent);
8.发送彩信
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);
StringBuilder sb = new StringBuilder();
sb.append("file://");
sb.append(fd.getAbsoluteFile());
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number, null));
// Below extra datas are all optional.
intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString());
intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent);
startActivity(intent);
9.发送Email
Uri uri = Uri.parse("mailto:xxx@abc.com");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
startActivity(it);
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_EMAIL, "me@abc.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"));
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
sendIntent.setType("audio/mp3");
startActivity(Intent.createChooser(it, "Choose Email Client"));
10.播放多媒体
Intent it = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("file:///sdcard/song.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);
11.uninstall apk
Uri uri = Uri.fromParts("package", strPackageName, null);
Intent it = new Intent(Intent.ACTION_DELETE, uri);
startActivity(it);
12.install apk
Uri installUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
13. 打开照相机
<1>Intent i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);
this.sendBroadcast(i);
<2>long dateTaken = System.currentTimeMillis();
String name = createName(dateTaken) + ".jpg";
fileName = folder + name;
ContentValues values = new ContentValues();
values.put(Images.Media.TITLE, fileName);
values.put("_data", fileName);
values.put(Images.Media.PICASA_ID, fileName);
values.put(Images.Media.DISPLAY_NAME, fileName);
values.put(Images.Media.DESCRIPTION, fileName);
values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileName);
Uri photoUri = getContentResolver().insert(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
startActivityForResult(inttPhoto, 10);
14.从gallery选取图片
Intent i = new Intent();
i.setType("image/*");
i.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(i, 11);
15. 打开录音机
Intent mi = new Intent(Media.RECORD_SOUND_ACTION);
startActivity(mi);
16.显示应用详细列表
Uri uri = Uri.parse("market://details?id=app_id");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//where app_id is the application ID, find the ID
//by clicking on your application on Market home
//page, and notice the ID from the address bar
刚才找app id未果,结果发现用package name也可以
Uri uri = Uri.parse("market://details?id=<packagename>");
这个简单多了
17寻找应用
Uri uri = Uri.parse("market://search?q=pname:pkg_name");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//where pkg_name is the full package path for an application
18打开联系人列表
<1>
Intent i = new Intent();
i.setAction(Intent.ACTION_GET_CONTENT);
i.setType("vnd.android.cursor.item/phone");
startActivityForResult(i, REQUEST_TEXT);
<2>
Uri uri = Uri.parse("content://contacts/people");
Intent it = new Intent(Intent.ACTION_PICK, uri);
startActivityForResult(it, REQUEST_TEXT);
19 打开另一程序
Intent i = new Intent();
ComponentName cn = new ComponentName("com.yellowbook.android2",
"com.yellowbook.android2.AndroidSearch");
i.setComponent(cn);
i.setAction("android.intent.action.MAIN");
startActivityForResult(i, RESULT_OK);
★intent action大全:
- android.intent.action.ALL_APPS
- android.intent.action.ANSWER
- android.intent.action.ATTACH_DATA
- android.intent.action.BUG_REPORT
- android.intent.action.CALL
- android.intent.action.CALL_BUTTON
- android.intent.action.CHOOSER
- android.intent.action.CREATE_LIVE_FOLDER
- android.intent.action.CREATE_SHORTCUT
- android.intent.action.DELETE
- android.intent.action.DIAL
- android.intent.action.EDIT
- android.intent.action.GET_CONTENT
- android.intent.action.INSERT
- android.intent.action.INSERT_OR_EDIT
- android.intent.action.MAIN
- android.intent.action.MEDIA_SEARCH
- android.intent.action.PICK
- android.intent.action.PICK_ACTIVITY
- android.intent.action.RINGTONE_PICKER
- android.intent.action.RUN
- android.intent.action.SEARCH
- android.intent.action.SEARCH_LONG_PRESS
- android.intent.action.SEND
- android.intent.action.SENDTO
- android.intent.action.SET_WALLPAPER
- android.intent.action.SYNC
- android.intent.action.SYSTEM_TUTORIAL
- android.intent.action.VIEW
- android.intent.action.VOICE_COMMAND
- android.intent.action.WEB_SEARCH
- android.net.wifi.PICK_WIFI_NETWORK
- android.settings.AIRPLANE_MODE_SETTINGS
- android.settings.APN_SETTINGS
- android.settings.APPLICATION_DEVELOPMENT_SETTINGS
- android.settings.APPLICATION_SETTINGS
- android.settings.BLUETOOTH_SETTINGS
- android.settings.DATA_ROAMING_SETTINGS
- android.settings.DATE_SETTINGS
- android.settings.DISPLAY_SETTINGS
- android.settings.INPUT_METHOD_SETTINGS
- android.settings.INTERNAL_STORAGE_SETTINGS
- android.settings.LOCALE_SETTINGS
- android.settings.LOCATION_SOURCE_SETTINGS
- android.settings.MANAGE_APPLICATIONS_SETTINGS
- android.settings.MEMORY_CARD_SETTINGS
- android.settings.NETWORK_OPERATOR_SETTINGS
- android.settings.QUICK_LAUNCH_SETTINGS
- android.settings.SECURITY_SETTINGS
- android.settings.SETTINGS
- android.settings.SOUND_SETTINGS
- android.settings.SYNC_SETTINGS
- android.settings.USER_DICTIONARY_SETTINGS
- android.settings.WIFI_IP_SETTINGS
- android.settings.WIFI_SETTINGS
- android.settings.WIRELESS_SETTINGS
- android.intent.action.ALL_APPS
- android.intent.action.ANSWER
- android.intent.action.ATTACH_DATA
- android.intent.action.BUG_REPORT
- android.intent.action.CALL
- android.intent.action.CALL_BUTTON
- android.intent.action.CHOOSER
- android.intent.action.CREATE_LIVE_FOLDER
- android.intent.action.CREATE_SHORTCUT
- android.intent.action.DELETE
- android.intent.action.DIAL
- android.intent.action.EDIT
- android.intent.action.GET_CONTENT
- android.intent.action.INSERT
- android.intent.action.INSERT_OR_EDIT
- android.intent.action.MAIN
- android.intent.action.MEDIA_SEARCH
- android.intent.action.PICK
- android.intent.action.PICK_ACTIVITY
- android.intent.action.RINGTONE_PICKER
- android.intent.action.RUN
- android.intent.action.SEARCH
- android.intent.action.SEARCH_LONG_PRESS
- android.intent.action.SEND
- android.intent.action.SENDTO
- android.intent.action.SET_WALLPAPER
- android.intent.action.SYNC
- android.intent.action.SYSTEM_TUTORIAL
- android.intent.action.VIEW
- android.intent.action.VOICE_COMMAND
- android.intent.action.WEB_SEARCH
- android.net.wifi.PICK_WIFI_NETWORK
- android.settings.AIRPLANE_MODE_SETTINGS
- android.settings.APN_SETTINGS
- android.settings.APPLICATION_DEVELOPMENT_SETTINGS
- android.settings.APPLICATION_SETTINGS
- android.settings.BLUETOOTH_SETTINGS
- android.settings.DATA_ROAMING_SETTINGS
- android.settings.DATE_SETTINGS
- android.settings.DISPLAY_SETTINGS
- android.settings.INPUT_METHOD_SETTINGS
- android.settings.INTERNAL_STORAGE_SETTINGS
- android.settings.LOCALE_SETTINGS
- android.settings.LOCATION_SOURCE_SETTINGS
- android.settings.MANAGE_APPLICATIONS_SETTINGS
- android.settings.MEMORY_CARD_SETTINGS
- android.settings.NETWORK_OPERATOR_SETTINGS
- android.settings.QUICK_LAUNCH_SETTINGS
- android.settings.SECURITY_SETTINGS
- android.settings.SETTINGS
- android.settings.SOUND_SETTINGS
- android.settings.SYNC_SETTINGS
- android.settings.USER_DICTIONARY_SETTINGS
- android.settings.WIFI_IP_SETTINGS
- android.settings.WIFI_SETTINGS
- android.settings.WIRELESS_SETTINGS
发表评论
-
查看Android应用包名package和入口activity名称
2014-08-05 16:20 2189使用android自动化测试工具monkeyrunner启动 ... -
设置默认应用
2014-05-15 11:46 1729setDefaultLauncher(); ... -
Android之APK文件签名——keytool和jarsigner
2012-10-10 14:06 1867一、生成密钥库将位置定位在jdk的bin文件中,输入以下命名行 ... -
Android中应用程序如何获得系统签名权限
2012-08-21 14:18 0有些库的使用条件比较苛刻,要求同一签名的程序才可以获得访问权。 ... -
Android中应用程序如何获得系统签名权限
2012-08-21 14:18 0有些库的使用条件比较苛刻,要求同一签名的程序才可以获得访问权。 ... -
Android权限共享UID和签名(转)
2012-08-21 14:17 1768共享UID 安装在设备中的每一个Android包文件(.ap ... -
android小结
2012-04-17 10:21 16361.获取屏幕的分辨率 在 Activity 里使 ... -
TextView实现电话、网址链接
2012-03-22 17:39 1655TextView是android中一个组件,具有autolin ... -
Android Eclipse JNI 调用 .so文件加载
2012-03-01 18:41 5975http://blog.sina.com.cn/s/blo ... -
Gallery加小点效果实现
2012-02-15 16:15 1696大家好: 心雨心今天又跟大家见面了 今天发布的是Gal ... -
如何解决:Android中 Error generating final archive: Debug Certificate expired on 10/09
2011-12-21 13:39 1626问题概述: 在导入一个app后提示如下错误(出现该问题, ... -
Android Google Map API 开发基础知识
2011-12-16 17:25 1779开发基于谷歌地图的应用和普通的android应用差不多都要 ... -
使一段字符串显示不同的颜色
2011-12-12 15:09 2679一种:字体颜色改变 String appna ... -
droid系统中使用TelephonyManager类来获取imei号和其他手机信息
2011-11-22 11:15 14831在AndroidManifest.xml文件中增加& ... -
CategoryAdapter控件
2011-11-17 10:50 1554使用方法: private Cate ... -
(转)Android开发:在EditText中关闭软键盘
2011-11-04 13:45 151851、EditText有焦点(focusable为true)阻止 ... -
获取未安装的APK图标
2011-09-01 10:38 1440网上关于"获取未安装的APK图 ... -
android ListView的美化涉及到的一些属性
2011-08-26 10:44 2376用心的朋友应该会发现,listview中在设置了背景之后。会有 ... -
ScrollView中嵌入ListView办法
2011-08-11 17:13 2276①layout布局代码: <ScrollView an ... -
android 混淆 去除第三方jar
2011-06-10 19:05 12521编译与反编译,一对相辅相成的 ...
相关推荐
android intent和intent action大全.doc
android intent和intent action大全
Android 广播大全 Intent Action 事件是 Android 系统中的一种核心机制,用于在应用程序之间传递信息和事件通知。 Intent 是一种轻量级的消息对象,用于描述一个操作的请求或描述一个事件。 以下是 Android 广播...
Intent在Android应用开发中,占有很大的分量,关于Intent在Android中的作用在网络上已经有很多资料了,这里不再累赘,本人喜欢直来直去。在网上看到很多关于Intent的资料,说那么多,你也许还是一头雾水,到底如何...
android Action call 拨打电话 Intent.ACTION.CALL
Android Intent Action
接收系统的时间流逝的广播,屏幕开启关闭的广播,电量改变的广播。这些广播在清单文件里注册时,看不到效果。在这个例子中通过在一个服务里面用代码注册的方式,成功接收了这些广播。
主要为大家详细介绍了Android利用Intent启动和关闭Activity的相关操作,感兴趣的小伙伴们可以参考一下
Android 广播事件 Intent Action 大全 Android 广播事件 Intent Action 是 Android 系统中的一种机制,用于在应用程序之间进行通信和交互。Intent.ACTION 是 Android 中的一种动作,用于描述一个具体的操作或行为。...
用Action跳转,用类名跳转,Intent的用法 1. 从google搜索内容 2. 浏览网页 3. 显示地图 4. 路径规划 5. 拨打电话 6. 发送短信 等等
android用于打开各种文件的intent
恢复已经停止的更新下载。 'android.server.checkin.FOTA_RESTART' 通过 OTA 下载并安装操作系统更新。 'android.server.checkin.FOTA_UPDATE' 用户按下了'Media Button'。...'android.intent.action.PACKAGE_ADDED'
Android Itent Action 小结
intent_action大全
Android Intent和Intent_Filter详解 Android Intent是 Android 组件间通信的载体,它们之间的通信是通过 Intent 对象在不断传递实现的。Android 的三大核心组件 Activity、Service 和 BroadcastReceiver 都是通过 ...
Android Intent Action 大全.doc
android intent
Intent intent = new Intent("android.intent.action.DIAL"); intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity"); startActivity(intent); ``` 通话记录界面 要跳转到通话...
android.intent.action.PACKAGE_REMOVED和android.intent.action.PACKAGE_ADDED 可以监听别的应用被安装卸载,但不能监听自己被卸载啊。 监听自己被卸载通过前辈们探索发现,只能通过监听系统卸载log如:act=...
android Intent使用案例 含:播放多媒体、打电话、发短信、发送email、发邮件、google服务、组件component、action值自定义、显示地图/路径规划、选择应用、打开应用列表、搜索应用等意图实例。