mercredi 14 juin 2017

Use checkboxes to store data, and update data everytime

When the user clicks a button I use an Intent to take them to a screen with 15 checkboxes. What I want is for the user to select a checkbox (or more than one) and then when they hit the OK button, the device stores that data in the form of adding a number next to the checkboxes id (aka if the first checkbox is called checkbox1 and the second is called checkbox2 and so on if the user selects the first checkbox three times in a row i want checkbox1 to say 3 next to it). Then later on in another activity I want to be able to access the top 5 checkboxes that have been selected and based on that show data (so if checkbox1 is in the top 5 and the question on the screen is favorite ice cream then the screen would show vanilla as being one of the top five favorite ice creams). How would I do this? I looked into shared preferences but wasn't sure exactly how to do it. Thanks




Aucun commentaire:

Enregistrer un commentaire