I have two screens. One of them is an output screen where there is a list view. The other one is an input where you can add values onto the list. The problem occurs when I input a variable onto the input screen 2 and when I return to the output screen 1, the variable is not in the list.
The code for screen 1 is:
Initialize global orders to create empty list When screen1.initialize do ** set global orders to call TinyDB1.Getvalue **
** tag - "ordertasks"
** ValueIfTagNotThere - create empty list set ListView1.Elements to - get global orders
What about the other Screen “add_order”, which I assume is the populating TinyDb? Need to see how TinyDb is populated and how Screen “add_order” is Closed/Screen1 returned to.
Your problem is at the bottom of the Button1.Click Block. You are opening another Screen1 - you already have one in the device memory. So change that to a “Close Screen” Block and App Inventor will return the User to the existing Screen1.
Note, ensure that both Screens are using exactly the same Name Tag in TinyDB
on both screens you first have to get the data from TinyDB…
you could avoid all that hassle if you used only one screen as already mentioned earlier…
Taifun