I am using NetworkImageView
to show some covers downloaded from a remote URL and I successfully manage to cache and show them, but I want to let users set their own cover images if they want.
I tried to use setImageUrl
method with Uri.fromFile(mCoverFile).toString()
as arguments, but it doesn't work. Since it is a mix of remote and local images I can't switch to regular ImageView
s, so I was wondering if there's any way to enable loading of local images.
I am of course aware of the ImageView
's setImageBitmap
method, but NetworkImageView
automatically resizes the created Bitmap
and also prevents View
recycling in GridView
s and ListView
s.
UPDATE: njzk2's answer did the trick. To autoresize the Bitmap according to your View
size, then just copy the ImageRequest.doParse
method from Volley's source.
FileURLConnection cannot be cast to HttpURLConnection
. – Phyllis