您的位置:首页 > 其它

intent- 启动其他应用

2015-02-06 16:20 169 查看
今天需要在图库中实现对相机的调用,代码如下

Intent intent = new Intent(Intent.ACTION_VIEW);
ComponentName componetName = new ComponentName("com.android.gallery3d",
"com.android.camera.CameraLauncher");
try {
intent.setComponent(componetName);
mContext.startActivity(intent);
} catch (Exception e) {
Toast.makeText(mContext, "可以在这里提示用户没有找到应用程序,或者是做其他的操作!", 0).show();
}


com.android.gallery3d:包名

com.android.camera.CameraLauncher:应用名

这里关键就是选找应用名,一般是到对应的应用模块下面查看androidManifest.xml来查看
注释:相机的应用都是在图库里面的,需要到图库的manifest.xml下查看相应的信息
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: