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 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短