我正在构建一个使用相机拍照的应用程序.这是我的源代码:
File file = new File(Environment.getExternalStorageDirectory(),
imageFileName);
imageFilePath = file.getPath();
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
//Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(intent, ACTIVITY_NATIVE_CAMERA_AQUIRE);
Run Code Online (Sandbox Code Playgroud)
在onActivityResult()方法上,我BitmapFactory.decodeStream()用来拾取图像.
当我在Nexus上运行我的应用程序时,它运行良好.但是当我在三星Galaxy S或HTC Inspire 4G上运行时,图像的方向是不正确的.

拍摄后的图像预览--------- SD卡上的真实图像
拍摄后的图像预览--------- SD卡上的真实图像