How to display image in imageview from sqlite database when in database I saved an uri to this image

897 views android
-3

In my application I take a photo and this captured photo shows in imageview. When I click 'save' this photo is saved to database ( to database I save an ur to this photo). And now, I want to display my save image in other imageview. How can I do this? How can I display an image from database in imageview ? Please, help me !

answered question

Please share the minimal form of the code, to expect precise help to your question.

Can you please post your code of whatever you tried.

You should save photo in file system and save URI to that image in SQLite.

1 Answer

12

Since you have not given the code, so I can't help but give you some general answer for your question.

You need to retrieve the URI from your database and after retrieving the URI from database, you need to parse it into URI format, using a code like this:

Uri mUri = Uri.parse("Data you got from db");

After that you can show it in ImageView, using a code like this:

imageView.setImageURI(mUri);

posted this

Have an answer?

JD

Please login first before posting an answer.