i have app for quotes.in which i have download and share option. and it is offline in which i have store the quotes image drawable folder . but if the user click any of my image then , if he like to add favorite then the image should save in favorite java class in the app . and i have toggle button for favorite and it s working perfectly .so kindly give code for (if anyone click the image it should should copy to the favorite class if he like to see favorite class then it should open and the user can see)favorite button.
Asked
Active
Viewed 1,086 times
1 Answers
0
Create an sqlite database then create a table of favorites then add column of image_name and resource_id (add other columns as your requirement). Then when user clicks image add this image resource id to favorites data base and access it when required
Go to the below link to know how to create,write and read operations in sqlite. https://www.journaldev.com/9438/android-sqlite-database-example-tutorial

Naveen Avidi
- 3,004
- 1
- 11
- 23