below button1 on screen1 doesn't switch to screen2 ; similarly button1 on screen2 doesn't switch to screen1
Screen1
Screen2
below button1 on screen1 doesn't switch to screen2 ; similarly button1 on screen2 doesn't switch to screen1
Screen1
Screen2
Are you testing in the Companion?
sorry, what do you mean by companion ?
Which option do you use to test?
?
(Canned response courtesy of TimAI2)
I think I see where you went wrong.
You are working only in the Designer.
Please watch this intro to the end ...
connect emulator
No I'm not working only in the designer as I am already shared above my block code for buttons on both screens
Don't mind me, but this isn't really the correct way of opening screens; you may incur a lot of wasted storage by not closing the screen (i.e., it will run in the background). Here's the accepted way:
This option runs your app under the Companion on the stock MIT emulator.
The Companion does not support screen switching. (ABG retraction)
To test screen switching, Build an .apk file and install it on your device or an emulated device.
It doesn't?
The Android companion simulates screen switching by informing the web editor when a new screen is opened, which causes the web editor to switch to that screen and send the corresponding code. The iOS companion more closely simulates what happens in a real app by pushing a new screen onto the view stack. In either case though, you should think of the set of open views as a stack. Opening a screen should be considered creating a new object (like clicking the link on a webpage pushes the current page onto the "Back" stack). Closing the screen does the opposite (equivalent of pressing the Back button in your browser).
Apparently, I am wrong.
I gave up on multi-screen apps so long ago, I can't recall when I saw the Companion complain about screen switching.
My apologies!
You may have been recalling that the companion does not allow closing the app, which it does because closing the companion would disconnect the session.
These blocks work (of course) also with → Companion and the → Emulator:
switchScreens3.aia (4.4 KB)
Thanks all for your support and great help, I have found that the issue is mainly in the live test on the browser itself, the application on browser was working before and now it is not working.
However, my code is working normally when testing either with the AI companion or emulator.
The issue here is when trying to test the code from just the web browser. [buttons are not switching to other screen]
There is no live testing in the browser.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.