Matisse: 作者可不可以把只启动手机进行拍照的api开放出来?

Created on 8 Aug 2018  ·  4Comments  ·  Source: zhihu/Matisse

如题,非常感谢.

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

        String contentPath = mediaStoreCompat.getCurrentPhotoPath();

}`

我这样使用

All 4 comments

只是一个图片选择器,只是顺带了拍照功能。如果想直接进行拍照,打开相机即可。

406

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

}`

我这样使用

同感,要是有单独拍照和单独获取相册的功能更加锦上添花 嘻嘻~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

naivor picture naivor  ·  7Comments

souragar picture souragar  ·  4Comments

liuzhanta picture liuzhanta  ·  5Comments

zybooo1 picture zybooo1  ·  5Comments

xiaotianchang picture xiaotianchang  ·  4Comments