android收藏

上传人:xy****7 文档编号:44834715 上传时间:2018-06-14 格式:DOC 页数:13 大小:261.50KB
返回 下载 相关 举报
android收藏_第1页
第1页 / 共13页
android收藏_第2页
第2页 / 共13页
android收藏_第3页
第3页 / 共13页
android收藏_第4页
第4页 / 共13页
android收藏_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《android收藏》由会员分享,可在线阅读,更多相关《android收藏(13页珍藏版)》请在金锄头文库上搜索。

1、javaview plaincopy/方法一 Intent intent=new Intent(); /包名 包名+类名(全路径) intent.setClassName(“com.linxcool“, “com.linxcool.PlaneActivity“); startActivity(intent); /方法二 Intent intent = new Intent(); ComponentName comp = new ComponentName(“com.linxcool“,“com.linxcool.PlaneActivity“); intent.setComponent(comp

2、); intent.setAction(“android.intent.action.MAIN“); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); 1.从 google 搜索内容javaview plaincopyIntent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY,“搜索内容“) startActivity(intent); 2.浏览

3、网页javaview plaincopyUri uri =Uri.parse(“http:/“); Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it); 3.显示地图javaview plaincopyUri uri = Uri.parse(“geo:38.899533,-77.036476“); Intent it = newIntent(Intent.Action_VIEW,uri); startActivity(it); 4.路径规划javaview plaincopyUri uri =Uri.parse(“

4、http:/ Intent it = newIntent(Intent.ACTION_VIEW,URI); startActivity(it); 5.拨打电话javaview plaincopyUri uri =Uri.parse(“tel:xxxxxx“); Intent it = new Intent(Intent.ACTION_DIAL,uri); startActivity(it); 6.发短信javaview plaincopy/方法1: Intent it = newIntent(Intent.ACTION_VIEW); it.putExtra(“sms_body“, “TheSM

5、S text“); it.setType(“vnd.android-dir/mms-sms“); startActivity(it); /方法2: Uri uri =Uri.parse(“smsto:0800000123“); Intent it = newIntent(Intent.ACTION_SENDTO, uri); it.putExtra(“sms_body“, “TheSMS text“); startActivity(it); /方法三: String body=“this is sms demo“; Intent mmsintent = newIntent(Intent.ACT

6、ION_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); 7.发送彩信javaview plaincop

7、yUri uri =Uri.parse(“content:/media/external/images/media/23“); Intent it = newIntent(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

8、.getAbsoluteFile(); Intent intent = newIntent(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(Messag

9、ing.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); 8.发送 Emailjavaview plaincopyUri uri =Uri.parse(“mailto:“); Intent it = newIntent(Intent

10、.ACTION_SENDTO, uri); startActivity(it); Intent it = new Intent(Intent.ACTION_SEND); it.putExtra(Intent.EXTRA_EMAIL,““); it.putExtra(Intent.EXTRA_TEXT, “Theemail body text“); it.setType(“text/plain“); startActivity(Intent.createChooser(it,“Choose Email Client“); Intent it=new Intent(Intent.ACTION_SE

11、ND); String tos=““; Stringccs=““; it.putExtra(Intent.EXTRA_EMAIL, tos); it.putExtra(Intent.EXTRA_CC, ccs); it.putExtra(Intent.EXTRA_TEXT, “Theemail body text“); it.putExtra(Intent.EXTRA_SUBJECT, “Theemail subject text“); it.setType(“message/rfc822“); startActivity(Intent.createChooser(it,“Choose Ema

12、il Client“); Intent it = newIntent(Intent.ACTION_SEND); it.putExtra(Intent.EXTRA_SUBJECT, “Theemail subject text“); it.putExtra(Intent.EXTRA_STREAM,“file:/sdcard/mysong.mp3“); sendIntent.setType(“audio/mp3“); startActivity(Intent.createChooser(it,“Choose Email Client“); 9.播放多媒体 javaview plaincopyInt

13、ent 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); 10.卸载 apkjav

14、aview plaincopyUri uri =Uri.fromParts(“package“, strPackageName, null); Intent it = newIntent(Intent.ACTION_DELETE, uri); startActivity(it); 11.安装 apkjavaview plaincopy Uri installUri = Uri.fromParts(“package“,“xxx“, null); returnIt = newIntent(Intent.ACTION_PACKAGE_ADDED, installUri); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(“file:/“ + filepath),“application/vnd.android.package-archive“); startActivity(intent);/ 安装 12. 打开照相机javaview plaincopy /1

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号