Skip to content
Advertisement

How to crop two different images in the same activity with different parameters in Android?

I am using this Crop library by SoundCloud. Selecting one imageview, slecting image, cropping and showing the result in the imageview works fine. But now I am trying to do it with two different imageviews with different specifications. I am not getting any errors nor am I seeing any results. Here’s what I have tried:

JavaScript

Advertisement

Answer

I haven’t used this library particularly, but custom request codes seem to be the problem.

Use different request codes for picking and cropping (total of 4 request codes) as you will need to handle them differently, and update onActivityResult(), handleCrop() to reflect that.

See https://gist.github.com/vibinr/fcf54c5e7ab63b9184432cc44c9a1494

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement