Android bug: Crop intent works on some file managers.
Following code:
Launch intent to crop image from folder/file.
Intent intent = new Intent(Intent.ACTION_GET_CONTENT,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
//intent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString());
intent.putExtra("crop", "true");
intent.putExtra("return-data", true);
startActivityForResult(intent, 0);
2 versions of code crash differently on different devices, same Android version.
1st verison:
try
{
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), targetUri);
}catch (FileNotFoundException e){e.printStackTrace();}
catch (IOException e){e.printStackTrace();}
Second version (works on other devices)
bitmap = (Bitmap) data.getExtras().get("data");
What am I suppose to do?