Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //限制只调用系统相机 final Intent intent_camera = ((Activity)getContext()).getPackageManager() .getLaunchIntentForPackage("com.android.camera"); if (intent_camera != null) { i.setPackage("com.android.camera"); } i.putExtra(MediaStore.Images.Media.ORIENTATION, 0); i.putExtra(MediaStore.EXTRA_OUTPUT, u); ((Activity)getContext()).startActivityForResult(i, 1);
Android 限制只调用系统相机 不弹出应用选择器
最新推荐文章于 2026-08-13 10:56:59 发布
这篇博客介绍了一个在Android应用中限制调用相机的方法,确保只会启动系统默认的相机应用,而不会显示应用选择器。通过获取系统相机包名并设置到Intent中,可以避免用户在拍照时看到其他相机应用的选项。

333

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



