Android-image-cropper: How to call only camera Intent?

Created on 19 Apr 2017  路  5Comments  路  Source: ArthurHub/Android-Image-Cropper

Most helpful comment

hi, i saw wiki but still no idea how to restrict the user to use only camera or only gallery

All 5 comments

see wiki and CropImage.getCameraIntent method.

hi, i saw wiki but still no idea how to restrict the user to use only camera or only gallery

For those who are looking for the same.
You need to call getCameraIntent which will simply give you an intent with action android.media.action.IMAGE_CAPTURE then on the result obtain you can call :

public static ActivityBuilder activity(@Nullable Uri uri) {
    return new ActivityBuilder(uri);
  }

e.g. CropImage.activity(uri).start(this)
The uri used in example is from MediaStore.EXTRA_OUTPUT that you used when passing to camera intent

can u more explain it...i not able to use it...plz
Intent intent = CropImage.getCameraIntent(this,null);
CropImage.activity().start(this);
but not worked...

@rmeph13 "intent" is an unused variable in your code sample.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ani24may picture Ani24may  路  5Comments

PujieWear picture PujieWear  路  5Comments

haoyd picture haoyd  路  5Comments

gilshallem picture gilshallem  路  8Comments

joseph-acc picture joseph-acc  路  9Comments