2017-05-17 145 views
0

我需要通過適當的圖像路徑ExifInterface(這是我從圖庫中選擇),選擇圖片的路徑,但我似乎無法得到它的工作...獲取從畫廊

File myFile = new File(selectedImageUri.getPath()); 
String patch = myFile.getPath(); 

這將返回:

/document/image:489 

我想檢測,如果圖像是rotaded與否,但沒有這個完整路徑即../images/test.jpg將無法正常工作。我如何獲得正確的圖像路徑?

回答

0

如何獲得正確的圖像路徑?

爲了什麼感覺就像是3,734 時間,沒有文件路徑

使用the ExifInterface from the Android Support library。它提供了一個構造函數,它需要一個InputStream。您可以通過ContentResolver上的openInputStream()獲取InputStreamUri