Android启动第三方程序的方法总结-成都快上网建站

Android启动第三方程序的方法总结

Android 启动第三方程序的方法总结

两当网站制作公司哪家好,找成都创新互联!从网页设计、网站建设、微信开发、APP开发、响应式网站建设等网站项目制作,到程序开发,运营维护。成都创新互联于2013年创立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选成都创新互联

方法一:

Intent intent = new Intent(); 
intent.setClassName(, ); 
startActivity(intent);

方法二:

Intent i=new Intent;
ComponentName com= new ComponentName( , ); 
i.setComponent(com); 
startActivity(i); 

启动媒体库

Intent i = new Intent();

ComponentName comp = new ComponentName("com.Android.camera","com.android.camera.GalleryPicker");

i.setComponent(comp);

i.setAction("android.intent.action.VIEW");

startActivity(i);

启动相机

Intent mIntent = new Intent();

ComponentName comp = new ComponentName("com.android.camera","com.android.camera.Camera");

mIntent.setComponent(comp);

mIntent.setAction("android.intent.action.VIEW");

startActivity(mIntent);

启动htmlviewer,并打开指定的一个文件 注意TXT不能是ANSI的,否则会乱码

Intent intent = new Intent();

ComponentName cn = new ComponentName("com.android.htmlviewer", "com.android.htmlviewer.HTMLViewerActivity");

intent.setComponent(cn);

Uri uri = Uri.fromFile(new File("/sdcard/demo.txt"));

intent.setDataAndType(uri, "text/plain");

startActivity(intent);

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!


新闻标题:Android启动第三方程序的方法总结
链接地址:http://kswjz.com/article/ihcesg.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流