I want that if I click on a button in Screen1, then it opens Screen2 and do a function on Screen2 immediately and also it is not possible to use Screen2 initialize block. So how can I do that?
Screen1
Set a boolean (true/false) variable in screen 1
Set this variable to tinydb
Screen2
Check the value of the variable in tinydb
If true, perform the function
You will need to use Screen Initialise to test the value, or to start a clock to test the value
Why can't you use screen initialise in Screen2? (just use a conditional statement - if/else)
... or Screen 2 could instead be a Virtual Screen.
When we define virtual screens, we use one 'real' App Inventor Screen (most often Screen1). Screen-sized Vertical Arrangements on it are displayed/hidden as required - they are the Virtual Screens. This is generally a better approach for multi-screen Apps, they share data without having to "pass" it between screens and it also reduces code duplication, making the App more efficient and the code easier to follow if you have to return to it at a later date.
So, instead of separate "houses", virtual screens are "rooms" of the same "house".