小米手机调用系统相机crash解决办法


if(resultCode ==RESULT_OK&& requestCode ==REQUEST_CODE_PICK_IMAGE)tion

{

//            mImageUri = data.getData();

//            String[] filePathColumn = {MediaStore.Images.Media.DATA};

//            Cursor cursor = getContentResolver().query(mImageUri, filePathColumn, null, null, null);

//            cursor.moveToFirst();

//            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);

//            mImageFilePath = cursor.getString(columnIndex);

//            cursor.close();

if(!TextUtils.isEmpty(data.getData().getAuthority())) {

String[] filePathColumn = {MediaStore.Images.Media.DATA};

Cursor cursor = getContentResolver().query(data.getData(),filePathColumn, null, null, null);

if(cursor ==null){

mActivityHelper.showNormalToast("找不到图片");

return;

}

cursor.moveToFirst();

intcolumnIndex = cursor.getColumnIndex(filePathColumn[0]);

mImageFilePath= cursor.getString(columnIndex);

cursor.close();

}else{

mImageFilePath= data.getData().getPath();

}

}

你可能感兴趣的:(小米手机调用系统相机crash解决办法)