Android應用程序允許用戶從他們的手機庫中選擇一張照片,並將URI保存到領域。然後我檢索這些信息並使用Picasso將它加載到圖像視圖中。出於某種原因,圖像未加載。Android無法使用Picasso從URI加載圖像
URI是這樣的:
content://com.android.providers.media.documents/document/image%3A333180
我使用mCategory.icon = imageURI.toString()
它保存到的境界,然後當我加載它:
Picasso.with(getContext())
.load(Uri.parse(mCategory.icon)) // mCategory.icon is a string
.resize(200, 200)
.error(R.drawable.mountain) // default image to load
.into(viewHolder.categoryIcon);
該Uri是無效的圖像路徑Uri。 – Enzokie