Android ImageView set to local URL not working?

If you don't HAVE to have it be an Uri you could do something like this instead String fullpath = Environment. GetExternalStorageDirectory() + "/pathtoyourfile" // take the path create a bitmap and populate the ImageView with it. ImageView iv = (ImageView) v.

FindViewById(R.id. Thumbnail); Bitmap bm = BitmapFactory. DecodeFile(fullpath); iv.

SetImageBitmap(bm).

If you don't HAVE to have it be an Uri you could do something like this instead. String fullpath = Environment. GetExternalStorageDirectory() + "/pathtoyourfile" // take the path create a bitmap and populate the ImageView with it.

ImageView iv = (ImageView) v. FindViewById(R.id. Thumbnail); Bitmap bm = BitmapFactory.

DecodeFile(fullpath); iv. SetImageBitmap(bm).

Sometimes the data that I am accessing is on internal storage, so I am not sure that that would work. – Tom Feb 23 at 23:02 URI. Parse maybe.

You just need a text path to your file. URI provides a few ways to get that. – Nelson Ramirez Mar 21 at 1:15.

Try loading it yourself and then passing it in: ContentResolver cr = getContentResolver(); InputStream in = cr. OpenInputStream(uri); Bitmap bitmap = BitmapFactory. DecodeStream(in); if (bitmap!

= null) { i. SetImageBitmap(bitmap); }.

Alright, I am very confused. So I checked bitmap, it was not null as I set a Toast in the case that it was, but at the same time no image was displayed! Could the URI from Intent.

EXTRA_STREAM be inaccurate? – Tom Feb 23 at 23:42 What is the URI? – EboMike Feb 23 at 23:43.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions