java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=131074, result=-1, data=Intent { (has extras) }} to activity
<p>hi am trying to upload image using camera or from gallery where my below code is working perfectly on lollipop devices but getting an error in jelly bean. its showing  <code>java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=131074, result=-1, data=Intent { (has extras) }} to activity</code></p>

<p>the below is my code in onActivity result</p>

<pre><code>@
Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode != Activity.RESULT_CANCELED) {
        if (resultCode == Activity.RESULT_OK) {
            if (requestCode == SELECT_FILE) {
                fileUri = data.getData();
                Log.d("gallery", "" + data.getData());
                performcropg(fileUri);
            } else if (requestCode == REQUEST_CAMERA) {
                fileUri = data.getData();
                performcrop(fileUri);
            } else if (requestCode == PIC_CROP) {
                if (data != null) {
                    Bundle extras = data.getExtras();
                    // get the cropped bitmap
                    Bitmap selectedBitmap = extras.getParcelable("data");
                    saveToInternalStorage(selectedBitmap);
                    Bitmap circleBitmap = Bitmap.createBitmap(selectedBitmap.getWidth(), selectedBitmap.getHeight(), Bitmap.Config.ARGB_8888);

                    BitmapShader shader = new BitmapShader(selectedBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
                    Paint paint = new Paint();
                    paint.setShader(shader);
                    paint.setAntiAlias(true);
                    Canvas c = new Canvas(circleBitmap);
                    c.drawCircle(selectedBitmap.getWidth() / 2, selectedBitmap.getHeight() / 2, selectedBitmap.getWidth() / 2, paint);


                    img_role.setImageBitmap(circleBitmap);

                }
            } else if (requestCode == pic_crop) {
                if (data != null) {

                    Bundle extras = data.getExtras();
                    // get the cropped bitmap
                    Bitmap selectedBitmap = extras.getParcelable("data");
                    saveToInternalStorage(selectedBitmap);
                    Bitmap circleBitmap = Bitmap.createBitmap(selectedBitmap.getWidth(), selectedBitmap.getHeight(), Bitmap.Config.ARGB_8888);

                    BitmapShader shader = new BitmapShader(selectedBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
                    Paint paint = new Paint();
                    paint.setShader(shader);
                    paint.setAntiAlias(true);
                    Canvas c = new Canvas(circleBitmap);
                    c.drawCircle(selectedBitmap.getWidth() / 2, selectedBitmap.getHeight() / 2, selectedBitmap.getWidth() / 2, paint);


                    img_role.setImageBitmap(circleBitmap);
                }
            }

        }
    }
}
</code></pre>