Search code examples
androidmotorola

Android Motorola devices always have cropping with choose image


My app has a choose image from library option to upload to server and when I select it on other devices including Android versions 2.3 and 4.0.3 it uploads fine. However, on my personal device which is a Motorola Droid Razr running 4.0.3 (confirmed on separate Razr) it forces me to crop the image first. It gives me the option to save or discard from the cropping screen and when I select save it crashes my app. (Edit: with an error java.lang.RuntimeException: Failure delivering result ResultInfo) Has anyone else had this problem with Motorola or specifically Razr devices? Any fixes for this or is this question better targeted for the Motorola development forums?

final Intent intent = new Intent(Intent.ACTION_PICK,
            MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    intent.putExtra("return-data", true);
    intent.setType("image/*");
    parent.startActivityForResult(intent, REQUEST_IMAGE_LIBRARY);

Solution

  • I finally figured this out by commenting out the line

    intent.putExtra("return-data", true);
    

    I don't know why that causes the RAZR to want to crop the image once selected.