打开系统相机方法:
1、 使用打开系统相机package,但有的手机相机名称不是这个默认名称 Intent intent = getPackageManager().getLaunchIntentForPackage(“com.android.camera”);
startActivity(intent);
2、 使用相机ACTION,打开相机应用
Intent intentCamera = new Intent();
intentCamera.setAction("android.media.action.STILL_IMAGE_CAMERA");
startActivity(intentCamera);
还有使用以下两种的
Intent
intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, null);
Intent
i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);
this.sendBroadcast(i);
本文介绍了通过不同方式启动Android设备系统相机的应用程序。包括直接指定包名、使用特定的动作字符串以及利用MediaStore和Intent.ACTION_CAMERA_BUTTON来启动相机。

2662

被折叠的 条评论
为什么被折叠?



