开发者

Android Crop Image crash

开发者 https://www.devze.com 2023-01-30 21:17 出处:网络
I\'m currently using the following code to ask the user to choose an image from memory and to crop it, but it keeps crashing.

I'm currently using the following code to ask the user to choose an image from memory and to crop it, but it keeps crashing.

      Intent i = new Intent(Intent.ACTION_PICK,
         android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);

  i.putExtra("crop", "true");
         i.开发者_JS百科putExtra("outputX", 90);
         i.putExtra("outputY", 90);
         i.putExtra("aspectX", 1);
         i.putExtra("aspectY", 1);
         i.putExtra("scale", true);

         startActivityForResult(i, 1); 

And then, inside "onActivityResult" I've found data.getData() is null (whether when I comment out the "crop" extra it contains the image Uri), and extras.getParcelable("data") is null as well. :S

Does anybody have any clue, please?


Ok, fixed adding i.putExtra("return-data", true); :D

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号