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下查看相应的信息
相关文章推荐
- intent 启动其他应用程序应用
- android 在应用中启动其他应用Intent的写法
- Intent调用其他应用setComponent启动其他应用程序
- 通过Intent中的setComponent来启动其他应用中的Service
- [Intent] 调用其他应用 setComponent
- 使用Intent启动常用的应用与服务
- android启动其他应用的一段代码
- activity能被其他的AP启动的条件 or android permission denied : starting Intent
- Android 使用Intent启动常用的应用与服务(转)
- Linux Qt编程——在程序中启动其他应用、脚本
- Intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
- 使用Intent启动常用的应用与服务
- jboss启动后其他机器无法访问jboss的应用
- Android中通过Intent调用其他应用的方法
- Linux Qt编程——在程序中启动其他应用、脚本
- Linux Qt编程——在程序中启动其他应用、脚本
- 使用intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
- 使用Intent启动常用的应用与服务
- android 跨应用跳转 启动其他应用指定界面
- Intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他