Blank screen after switching screens

This is a BMI calculator, but when I click on the "Calculate" button, it is supposed to switch to the screen with the right text. Even though it switches to the correct screen, nothing shows up, only a white screen.
apkxt.

1 Like

show your relavent blocks please.

Hey, those are the blocks:



image
image
image

It looks fine for me.
Are you testing in companion? it's possbile to close Screen1?
Try it in APK please.

But the wise way is to use virtual screens

I downloaded the "app inventor" app from the app store (IOS), and that's what I am using to test it. I tried to download the emulator but I could not launch propperly.

then please change the category to iOS.
I never used iOS, maybe other PU can help.

1 Like

Also I forgot to mention, when I try to change the screen through the website multiple types I get this error: Error from Companion: error: RuntimeError. (irritants: "Cannot find the component: Screen3", "Problem with application")

Thank you for your help anyway.

Welcome to the Community Leo.

There is too much wrong with your code.

Firstly, you do not need a screen for each possible result - only one screen can be displayed at a time, so design your App to use one result screen.

Secondly, you cannot use "open another screen" to open Screen1. Screen1 already exists in memory, so you are opening additional Screen1s and that will crash or lock your App (Blank Screen).

We cannot follow the flow of your code from the Blocks you have posted, but if you fix the issues I have explained, your App may be OK.

1 Like

Thank ou for your feedback. I tried to follow your advice and deleted all screens with the exception of screen 1.


Then I created the following one:

Even so, a blank screen appears when I press the calculate button.

What does blank screen mean? Can you record a video or take a screenshot of this blank screen? Do you mean that you don't have any labels, buttons or other components on the screen? Don't they just fill it with data?

1 Like

Where is the calculate button? Where are the values it should calculate? Perhaps there is an error in your equation such that the App hangs (locks up) when trying to solve it?

Also, using only two Screens now, your 'open another screen' is not appropriate. Open Screen 2 from Screen 1. To return the User to Screen1 simply, close Screen2.

1 Like

It was the same here on IOS as well. Download this aia and try it out for yourself. see if the data from screen 1 appears on screen 2.

1 Like

Hi, sorry for the delayed response. This is what I mean by blank screen:


I also downloaded the file you uploaded and this is what I got:

Hi, sorry for the delayed response. This is the "Calculate" button:


And this is its code:

(the formula in there is weight/height*height)
Regarding the closing/opening of another screen, I tried to follow your advice and this is what I got now for screen 2:

As you can see in my example screen 2 opens correctly. Also data 12345 is passed from screen1 to screen2 so everything is ok on ai2 side. There is a bug somewhere in your aia project.
All we can do is check your project in our tel. Put your aia here.

1 Like

Ok, here it is:
CALCULADOR_IMC (1).aia (75.0 KB)

1 Like

It shows up fine on android. Maybe try to start from the beginning and create these screens in a new project, but don't copy the screens, just make them manually.

When testing in companion, did you try to switch the screen manually? In the green bar next to the name of the app. After selecting screen2, screen2 should appear in the companion.

This is what shows up if I try to change the screens, manually:

So there is some bug with companion, or your project is corrupted internally somehow. Try creating a completely new project.