当前位置:   article > 正文

怎样能够调用系统自带相机,而禁止出现选择第三方相机的选项_android拦截原生相机

android拦截原生相机

打开系统相机方法: 

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);


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/461411
推荐阅读
相关标签
  

闽ICP备14008679号