只能点击图库上传图片,点击最近图片上传程序直接卡死,求解决
private void originalImage(Intent data) {
/*
* switch (requestCode) {
*/
// case FLAG_CHOOSE:
Uri uri = data.getData();
Log.e("lcy",uri+" uri");
//Log.d("may", "uri=" + uri + ", authority=" + uri.getAuthority());
if (!TextUtils.isEmpty(uri.getAuthority())) {
Cursor cursor = getContentResolver().query(uri,
new String[] { MediaStore.Images.Media.DATA }, null, null,
null);
if (null == cursor) {
//Toast.makeText(mContext, R.string.no_found, Toast.LENGTH_SHORT).show();
return;
}
cursor.moveToFirst();
String path = cursor.getString(cursor
.getColumnIndex(MediaStore.Images.Media.DATA));
Log.e("lcy", path+" path");
String extension = path.substring(path.lastIndexOf("."), path.length());
if(FeatureFunction.isPic(extension)){
Intent intent = new Intent(mContext, RotateImageActivity.class);
intent.putExtra("path", path);
startActivityForResult(intent, REQUEST_GET_BITMAP);
//startPhotoZoom(data.getData());
}else {
//Toast.makeText(mContext, R.string.please_choose_pic, Toast.LENGTH_SHORT).show();
}
//ShowBitmap(false);
} else {
Log.d("may", "path=" + uri.getPath());
String path = uri.getPath();
String extension = path.substring(path.lastIndexOf("."), path.length());
if(FeatureFunction.isPic(extension)){
Intent intent = new Intent(mContext, RotateImageActivity.class);
intent.putExtra("path", path);
startActivityForResult(intent, REQUEST_GET_BITMAP);
}else {
//Toast.makeText(mContext, R.string.please_choose_pic, Toast.LENGTH_SHORT).show();
}
//mImageFilePath = uri.getPath();
//ShowBitmap(false);
}
}