读书人

起动应用的方法以camera模块为例

发布时间: 2013-08-09 15:16:24 作者: rapoo

启动应用的方法,以camera模块为例

//通过包名和类名启动activity ?

??private?void?openCamera()?{

? ? ? ? Logger.d(TAG,?"openCamera");

? ? ? ??ComponentName?component =?new?ComponentName("com.android.camera",?"CameraLauncher");

? ? ? ? Intent intent =?new?Intent();

? ? ? ? intent.setComponent(component);

? ? ? ??mActivity.startActivity(intent);

? ? }

?

//通过action启动应用

? ??private?void?openCamera() {

? ? ? ? Intent intent =?new?Intent();

? ? ? ? intent.setAction("android.media.action.STILL_IMAGE_CAMERA");

? ? ? ??mActivity.startActivity(intent);

? ? }

读书人网 >移动开发

热点推荐