开发者

onActivityResult not called when picture taken in landscape mode (HTC Evo 3d)

We are calling the camera intent like this:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
   Uri.fromFile(new File(imageDirectory.toString() + "/" + id + ".jpg")));
startActivityForResult(intent, CAMERA_INTENT);

We handle the result like this:

@Override
protected void onActivityResult(int requestCode, int resultCode, Inten开发者_Go百科t data)
{
    // Log.v(TAG, ">>> onActivityResult()");

    super.onActivityResult(requestCode, resultCode, data);
    switch (requestCode)
    {
        case CAMERA_INTENT:
            handleCameraIntent(resultCode);
            break;
        case IMPORT_PICTURE_INTENT:
            handleImportIntent(resultCode, data);
            break;
        default:
            break;
    }

}

This works fine 99% of the time. However, we were testing on an HTC Evo 3d and the onActivityResult method would not get called, if the portrait was taken in landscape mode. But onActivityResult was called when in portrait mode.

Has anyone else ran into this? Is there an easy solution?

UPDATE: It looks like onActivityResult is being called, but AFTER onResume. According the the documentation this is not possible....

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜