I'm currently working on an MIT App Inventor project where I need to save user scores and display them in a ListView on another screen. However, I'm facing an issue where the scores get overwritten each time I add a new score, instead of being appended to the existing list.
Before adding something to the list, first read it from TinyDB
And for lists, set the socket valueIfTagNotThere to a create empty list instead of an empty text block
Taifun
what is the difference between prevScore and nameDB?
Read nameDB before adding something to nameList
Taifun
- this is redundant and can be removed
- use the close screen block, see also here how to switch screens correctly
App Inventor Tutorials and Examples: Manager Screen | Pura Vida Apps
Taifun
- not required
- set global nameList to ...
- use the normal open another screen block
you already have the nameList in TinyDB, just read it from there in the other screen - use only one TinyDB with different tags
the namespace of that TinyDB should be the same for all screens, for example TinyDB1 - again switch screens corectly and use the close screen block here
Taifun