0
未知的URL文件獲取上述錯誤java.lang.IllegalArgumentException異常:在android.content.ContentResolver.delete
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (mImageCaptureUri != null)
{
//exception at below line
getContentResolver().delete(mImageCaptureUri, null,null);
mImageCaptureUri = null;
}
}
});
我嘗試檢查,如果文件被new File(mImageCaptureUri.getPath()).exists()
它的存在,但我依然得到了異常,因爲存在
java.lang.IllegalArgumentException: Unknown URL file:///storage/sdcard0/tmp_avatar_1412858553212.jpg
at android.content.ContentResolver.delete(ContentResolver.java:984)
看起來不像一個有效的(即系統定義的)內容URI。你想達到什麼目的? – Trinimon 2014-10-09 12:48:39