我制作了一个应用程序,允许用户使用我的应用程序拍摄并编辑它。我拥有一个三星银河恒星,它在它上面运行良好。我让我的朋友下载了该应用程序,当她在手机上对其进行测试时,每当她拍照并点击“保存”时,我的应用程序就会崩溃。她使用银河s3。
这是我拍照时的代码
case R.id.ibTakePic:
i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+File.sep arator + fileName2 + ".jpg");
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
rotatePic = true;
startActivityForResult(i,cameraData);
break;
这是我的结果代码..
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
pictake = true;
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
rotatePic = false;
bmpReceive = rotate(picturePath);
bmpOriginal = bmpReceive;
picTaken.setImageBitmap(bmpReceive);
// ImageView imageView = (ImageView) findViewById(R.id.imgView);
// imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
}