TakePhoto
TakePhoto copied to clipboard
Android nexus 6.0 系统, 总是提示没有相机. 已开启相机权限
你好. 在 Android nexus 6.0 系统, 拍照时总是提示没有相机. 但相机权限是打开的, 手机相机没有问题.我看源码发现出现提示的位置如下: /** * 拍照前检查是否有相机 **/ public static void captureBySafely(TContextWrap contextWrap,TIntentWap intentWap)throws TException{ List result=contextWrap.getActivity().getPackageManager().queryIntentActivities(intentWap.getIntent(),PackageManager.MATCH_ALL); if (result.isEmpty()){ Toast.makeText(contextWrap.getActivity(),contextWrap.getActivity().getResources().getText(R.string.tip_no_camera),Toast.LENGTH_SHORT).show(); throw new TException(TExceptionType.TYPE_NO_CAMERA); }else { startActivityForResult(contextWrap,intentWap); } } 是 result 返回为空, 才提示没有相机. 所以,我想请问,是不是上述代码有问题?