We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if (resultCode == Activity.RESULT_OK && requestCode == SYSTEM_GALLERY) { Uri uri = data.getData(); String[] pojo = {MediaStore.Images.Media.DATA}; Cursor cursor = this.managedQuery(uri, pojo, null, null, null); if (cursor != null) { // ContentResolver cr = this.getContentResolver(); int colunm_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); String path = cursor.getString(colunm_index); //以上代码获取图片路径 Uri.fromFile(new File(path));//Uri.decode(imageUri.toString()) mEditorFragment.getPerformEditable().perform(R.id.id_shortcut_insert_photo, Uri.fromFile(new File(path))); } else { Toast.showShort(this, "图片处理失败"); } }
这段代码处理有问题!cursor很多时候为空。
The text was updated successfully, but these errors were encountered:
谢谢,回头我重新做一下图片选择!应该是机型适配问题,你能不能提供一下机型和系统版本? @18611480882
Sorry, something went wrong.
小米
小米note 有这个问题
小米4有这个问题
No branches or pull requests
if (resultCode == Activity.RESULT_OK && requestCode == SYSTEM_GALLERY) {
Uri uri = data.getData();
String[] pojo = {MediaStore.Images.Media.DATA};
Cursor cursor = this.managedQuery(uri, pojo, null, null, null);
if (cursor != null) {
// ContentResolver cr = this.getContentResolver();
int colunm_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
String path = cursor.getString(colunm_index);
//以上代码获取图片路径
Uri.fromFile(new File(path));//Uri.decode(imageUri.toString())
mEditorFragment.getPerformEditable().perform(R.id.id_shortcut_insert_photo, Uri.fromFile(new File(path)));
} else {
Toast.showShort(this, "图片处理失败");
}
}
这段代码处理有问题!cursor很多时候为空。
The text was updated successfully, but these errors were encountered: