Close screen and open another screen

I am using the first block. Are this two blocks doing the same?
I want to close screen2 and open screen1 again with start value.

.
I know there are a lot of posts for that.
I want to use on screen1 the otherscreenclosed event, but it always triggers the initialize event. see also here:

Using TinyDB instead is not working proberly.

Then use the close screen with value block and test it using the apk fle

Taifun

This block closes the app, the app was created with the apk file.
grafik
Is there something wrong?
This is the screen2 block to open main screen1:
grafik

Have you only 2 screens in your app?

yes, only two screens

How do you open Screen2?
If you use the manager screen method it should work...

Taifun

I open Screen2 with this method, with this block i want to be sure to close Screen1 and not to run in memory issues.
The close screen with value block.. doesnt work as it only closes screen1.
grafik
I will have a look at the manager screen you prefered.

You can use that event only together with the manager screen method

You are using a variation of the Tribblehunter method... which means, there is only 1 screen open at any time and the OtherScreenClosed method never will get triggered

Taifun

The manager screen method is working fine now, great Taifun :+1:.
The only thing i am missing is the start value which i need to forward from
Screen2 to Screen1. I used it with the Tribblehunter method without TinyDB.
Can i do this also with the manager screen method?

On Screen1 i can get the start value:
grafik

I will try this one later...
grafik
The response of get result is only Screen1?

possible but first time when you run the app it will open Screen 1 only. So what will you do that time?

use one if then logic if needed

You are right, the if then logic is the only way i can manage it.
When Screen1 initialize first time i have to use an if then block like below, i need to use a TinyDB "Neustart" tag to check if the Screen1 is opened by Initialize or if it returns from Screen2 because the OtherScreenClosed event doesnt work with a start value for me.
The problem is that Screen1 always starts only by initialize event and when the user is closing the app or uses backpressed block the TinyDB start tag has always to be resetted to true. But with OtherscreenClosed and the manager screen tip from @Taifun i have no opportunity to use the start value from Screen2.
grafik

My workaround with the ActivityStateChanged block is also not working, as the block is necessary in Screen2 instead of Screen1.
grafik

Use argument result instead of start vslue

Taifun

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.