public String getPath(Uri uri) {
String[] projection = { MediaStore.Images.Media.DATA };
@SuppressWarnings("deprecation")
Cursor cursor = managedQuery(uri, projection, null, null, null);
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
但我试试这个,仍然是错误
public String getPath(Uri uri) {
String res = null;
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(contentUri, projection, null, null, null);
if(cursor.moveToFirst()){;
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
res = cursor.getString(column_index);
}
cursor.close();
return res;
}
我该怎么办?在LogCat中仍然显示错误,无法处理图像
找不到长期org.opencv.highgui.Highgui.imread_0(java.lang.String,int)的实现(尝试过Java_org_opencv_highgui_Highgui_imread_10和Java_org_opencv_highgui_Highgui_imread_10__Ljava_lang_String_2I)