Is save button state possible?

I have a multiple choice quiz app and each question is a ListPicker. When the user selects an answer from the list, the ListPicker gets disabled (you cant click on it anymore). I’ve implemented a scoring feature as well.

There are dozens of questions and I would like to save the progress so that when a user exits the app and then opens it again, they will have the ability to load their progress - the score and the state of the ListPicker - disabled or enabled.

Any light, suggestion or hint on this is highly appreciated:

You can use the Screen Closed block or Screen Pause in the Screen section for blocks… It won’t have those exact words as I’m not home right now but, they’ll be there so just look for maybe Pause, Close, and Resume.

1 Like

Thanks Nathan, but still…when the application is restarted or the screen is reinitialized, everything would be lost.

TinyDB is the answer. It is used for persistence of data across sessions.

1 Like

I’m on that route but I dont have an idea on how to save/load the button state…Can you be a bit more specific?

You can save your state with tag Component.Property or User.score or User.currentLevel and its respective value.

1 Like

I tried that but the issue is when I would be loading it. See my blocks above. I cant figure out how to load component property. So I’m saving all buttons in a list and I cant get their property.

Could you suggest something please?

You use them when required.

See this example demonstrating how to count button clicks and save it to TinyDB

With all due respect, that does not see to help Pavitra. It’s too simplistic for what I have. I need to save all button (or in my case, ListPicker states). If you look at the blocks below, the Save button seems to work, but when I hit the load button, is say that foreach argument cannot be an empty list…

L.E.:

Alright guys. I think I figured it all out. Thanks a bunch for the willingness to help! I really appreciate that.