i have spinner component and i want to assess it from different screen.
and i also want the user to be able to add item to the spinner.
HOWTO: Transfer data between screens using TinyDB Demo.
HOWTO: Transfer data between screens using Start Value Demo.
Use different screens wisely
- Before starting to create another screen, first you should think about is it really necessary?
- See also Building apps with many screens and SteveJG's post about advantages/disadvantages, because in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed...
- See also Martyn_HK's example about how to use Tabs in App Inventor and another example from Cyd. and my Tabbed Screens Demo
If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...
The recommended method of switching screens in App Inventor
(Thanks Taifun)
Also see demo: multiscreen.aia
1 Like
Do you want to access the Component or the item the user has selected?
is the component i want to assess
Hello Opk
I suggest you use Virtual Screens. That’s a “real” screen populated with screen-sized Vertical Arrangements, each Arrangement = 1 Virtual Screen. This way, you have access to all components in the same set of Blocks.
For the User to add items to a Spinner:
- Keep a Blocks List as the source of the items
- Provide the User with a Text Component or pop-up input to enter the name of a new item.
- Add that new item to the Blocks List.
- Clear the Spinner’s list, and repopulate it with the Blocks List.
- The Blocks List can be preserved by saving it in TinyDB.
1 Like