如题,非常感谢.
只是一个图片选择器,只是顺带了拍照功能。如果想直接进行拍照,打开相机即可。
`mediaStoreCompat= new MediaStoreCompat(this);
mediaStoreCompat.setCaptureStrategy(new CaptureStrategy(true, Constants.PROVIDER_AUTHORITY));
mediaStoreCompat.dispatchCaptureIntent(this, REQUEST_CODE_CAMERA);`
`if (requestCode == REQUEST_CODE_CAMERA&& resultCode == RESULT_OK) {
String contentPath = mediaStoreCompat.getCurrentPhotoPath();
}`
我这样使用
同感,要是有单独拍照和单独获取相册的功能更加锦上添花 嘻嘻~
Most helpful comment
`mediaStoreCompat= new MediaStoreCompat(this);
mediaStoreCompat.setCaptureStrategy(new CaptureStrategy(true, Constants.PROVIDER_AUTHORITY));
mediaStoreCompat.dispatchCaptureIntent(this, REQUEST_CODE_CAMERA);`
`if (requestCode == REQUEST_CODE_CAMERA&& resultCode == RESULT_OK) {
}`
我这样使用