How I can get Screen name as a value

Hi everyone,

I looked at various topics regarding multiscreen and switching information between screens, but I did not find a solution that interests me. Here's my problem.

I have several screens (5). The first (Sreen1) redirects to screens with different topics (2 screens). From these screens, you can view the content of texts (txt, html) or web pages. The screen for reading plain text and the second screen with the webviewer are responsible for this. I'm looking for a solution with a "BackPressed" procedure.

I have no problem with the text reading screen, I have a problem with the webviewer screen. The "BackPressed " procedure should return to the screen where the query came from, i.e. to screen 1 or 2.

How can I write a procedure, most likely using tinydb to remember the name of the screen to use that name to open the correct screen.

If I remove the reference to open the screen from “when Screen Website.BackPressed” the block “call Open_Screen, OpenScreen: Screen1” the webviewer closes the webpage and leaves a blankpage. How can I supplement this procedure with retrieving the name of the screen where the command came from.

Does anyone have experience with such a problem?

Uh uh. I notice an issue here, do not open screen1 that is gonna cause memory issues, use only the close screen block it should work. :wink:

and I think creating a procedure for it is unnecessary :thinking:

When opening the screen from another, pass the previously-open screen's name as a start value.
During the BackPressed event, compare the content of the start value.

1 Like

Hi NishyanthKumar,
I previously-open screen I have start value to open certain page in ScreenWebViewer (Screen name is Website).

Where and how I put startValue of this Screen (we can name it Screen2)?
And where/how I compare this in BackPressed event?
I know that it could be a silly question, only in this moment I can`t see how it could be done.
For :AyProduction : I must have possibility be back from page to page in WebViewer not only close the Screen.

Why did you use the if then block?

To open another screen with data stored in tinydb and close this screen. In this way only one screen is open.
I think.

But there is still no function of it.
(sorry if it's off-topic)

It`s works many years. Maybe something was change but I go the old way. see Anke response.

The 'if then' is completely spurious - try the block with that 'if' removed.

I will be back to my main question.
"How do that the "BackPressed " procedure should return to the screen where the query came from, i.e. to screen 1 or 2."
How I put "dynamic" value to this block:

NishyanthKumar suggested to put Screen name in a start value (of Screen1 or Screen2) and then compare content during BackPressed event. But I can`t see in which place and how to do this.
In the Webview screen I want keep this possibility to working on Internet pages and going back to Screen1 or Screen2.

In that case, you might try this:

(I don't guarantee you that this would work though)
Also, I didn't use procedure cuz I still don't understand why you need it. You might use it if you want.

Firstly, the dynamic value - when 'Screen1' opens 'ScreenWebsite', it can pass the number 1 to 'ScreenWebsite' and similarly 'Screen2' can pass number 2.

However, this is not necessary. You can simply use the Close Screen Block and the User will be returned to the Screen that most recently opened 'Screen Website'.

It opens a 2nd instance of Screen1, which will eventually cause the App to crash.


But it's not crashing for me, and it's working fine
Here's the aia. :
web.aia (3.8 KB)

It depends on the over-all memory allocation for the App how large/sophisticated the screens are and how long the App is run.

Just because you can drive your car on 3 wheels instead of 4, should you?

It was happen and will happen again :wink: so in this ChrisWard is right. For this normally I close every Screen first to pass to another.
In your aia you pass start value Screen name, but in my case I pass web page address. I cant see place to put another start value. ChrisWard how I can pass these numbers and read them in BackPressed event. Can you show some block. As I said I fill blocked and I cant see how. I know that this is something simple.
I use these blocks to have possibilities to work inside web page:

if not hole Screen will be closed. I think. If I remember what happened once.

Give me 10 minutes to make a simple example

Try this, it's rough, but the basic requirement for reliability is there.

ChangeScreens.aia (4.5 KB)

Yes this blocks work. But. Try navigate in this open page. If you choose back you don`t be back to previous page but close the Screen.
I will try this:

and tell what happen.

You do not need to be concerned with CurrentUrl v HomeUrl, the Url displayed is always the current one when the ScreenWebsite is opened. Therefore, there is only one web page displayed and WebViewer1.GoBack is not required (has nothing to go back to).