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://www.csruizhi.cn/article/ihcesg.html

其他资讯

Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
友情链接: 攀枝花网站设计 成都网站建设 达州网站设计 移动手机网站制作 手机网站制作 H5网站制作 高端网站设计 网站建设公司 成都网站建设 成都网站设计 阿坝网站设计 成都企业网站制作 四川成都网站制作 广安网站设计 成都网站建设公司 成都网站建设 营销型网站建设 成都网站制作公司 网站建设开发 高端定制网站设计 网站设计制作报价 手机网站设计