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);
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下