ACTION_IMAGE_CAPTURE returns imagefile as Extra instead of Data
<p>One feature of my app includes the camera. The user takes a picture and the app displays the image.</p>

<p>I start an intent with ACTION_IMAGE_CAPTURE using StartActivityForResult and capture the response with onActivityResult. <strong>Usually</strong> I can simply call <em>getData()</em> on the intent I receive in onActivityResult and get the content uri for the MediaProvider.</p>

<p>My problem is the following: One one of my test devices, a Huawei ALE-L21, the intent I get in onActivityResult has no data, but instead, it has a parcellable extra. How could I get the users photo from that? Android Studio doesn't tell me the name of the parcellable extra either</p>

<hr>

<p><strong>Disclaimer: I call getActivity() because I'm using this code in a fragment</strong></p>

<hr>

<p>This is what I use to get the camera.</p>

<pre><code>Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
    startActivityForResult(takePictureIntent, getResources().getInteger(R.integer.RQ_PERMISSION_WRITE_EXTERNAL_STORAGE));
}
</code></pre>

<hr>

<p>And here's the code in my onActivityResult</p>

<pre><code>@Override
public void onActivityResult(int requestCode, int resultCode, Intent resultIntent) {
    super.onActivityResult(requestCode, resultCode, resultIntent);

    switch (requestCode) {
        case 1: //RQ_ImageCapture
        case 2: //RQ_ImageSelected
            if (resultIntent != null) {
                try {
                    Uri selectedImage = resultIntent.getData();
                    if(selectedImage != null) {
                        Bitmap bitmap = 
                        MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), selectedImage);
                        setImageAsBackground(selectedImage, bitmap);
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            break;
    }
}
</code></pre>