0

I have a list view in my app which consists of:

  1. ImageView
  2. TextView
  3. Button

I want that when the user clicks on that button textview gets stored in database along with the name of the image which is stored in drawable folder. Now on another activity i need to show the listview which consists of only the items selected by the user. I don't know how to store image in database and retrieve it. Please help!

I have seen many questions on Stackoverflow but none is solving my problem exactly.

1 Answers1

0

Check out this link.How to store(bitmap image) and retrieve image from sqlite database in android? .Also you should not store raw images in sqlite tables .Instead store their path to the directory.Hope it helps.

Community
  • 1
  • 1
mik dass
  • 381
  • 3
  • 16
  • This is for storing the image itself in the sqlite. I don't want that...I want name to be stored See question again. If you could help please! – Abhinav Garg Jul 07 '15 at 17:58
  • You may retrieve the id of the imageview by -v.getId();-Just store this Id in the database and as for the textVIew ,You may use -String str=tv.getText().toString(); - and store it in the database.For populating listview use the image id and text from the database.Hope it helps. – mik dass Jul 07 '15 at 18:52