Convert file: Uri to File in Android

What you want is…

new File(uri.getPath());

… and not…

new File(uri.toString());

NOTE: url.toString() return a String in the format: "file:///mnt/sdcard/myPicture.jpg", whereas url.getPath() returns a String in the format: "/mnt/sdcard/myPicture.jpg",

 

from:
http://stackoverflow.com/questions/2975197/convert-file-uri-to-file-in-android

相關文章

寫留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *