Android 启动第三方程序的方法总结
Android启动第三方程序的方法总结
方法一:
Intentintent=newIntent(); intent.setClassName(, ); startActivity(intent);
方法二:
Intenti=newIntent; ComponentNamecom=newComponentName(, ); i.setComponent(com); startActivity(i);
启动媒体库
Intenti=newIntent();
ComponentNamecomp=newComponentName("com.Android.camera","com.android.camera.GalleryPicker");
i.setComponent(comp);
i.setAction("android.intent.action.VIEW");
startActivity(i);
启动相机
IntentmIntent=newIntent();
ComponentNamecomp=newComponentName("com.android.camera","com.android.camera.Camera");
mIntent.setComponent(comp);
mIntent.setAction("android.intent.action.VIEW");
startActivity(mIntent);
启动htmlviewer,并打开指定的一个文件注意TXT不能是ANSI的,否则会乱码
Intentintent=newIntent();
ComponentNamecn=newComponentName("com.android.htmlviewer","com.android.htmlviewer.HTMLViewerActivity");
intent.setComponent(cn);
Uriuri=Uri.fromFile(newFile("/sdcard/demo.txt"));
intent.setDataAndType(uri,"text/plain");
startActivity(intent);
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短