Inquiry about Building Apps with Many (Actual Real) Screens

I am creating an app where Screen1 has 5 buttons. When each button is clicked, it opens another screen with 7 buttons. Each of these buttons, when clicked, opens a PDF file via an extension that I added to my application.

I want that when the click on BackPressed while a PDF file is open, instead of going back to Screen1, it returns to the same screen with the 7 buttons.

Your description only indicates two screens (not many) so far...

How is the extension you mention showing the pdf, within your app ?

Have you used the Screen BackPressed event block to handle what happens when you press the back button?

The extension displays the file online direct url.

For example, in Screen 2, there are seven buttons. When each button is pressed, it opens a specific PDF file via an extension. I used layout for showing the PDFView.

When using Block → when Screen2 BackPressed do open another screen (screen1) → Already Moves to Screen1,

But I want when I click on BackPressed while viewing the PDF file, it will move to the same screen, which has seven buttons, and I do not want to move to screen1.

Set the BackPressed event to close the layout displaying the pdf, and reset the visibility of your buttons so that you are back on the initial page view?

Yes

Does this mean it works now ?

I am having to guess because you do not show us anything (blocks/screens etc.)


This is Blocks of Screen1 and Screen2

  • I want Set the BackPressed event to close the layout displaying the pdf, and reset the visibility of your buttons so that you are back on the initial page view.

  • But what happens to me, for example, is when I view a PDF file on Screen2 and clicking on BackPressed goes to screen1, while I want to back into the initial page view (Screen2) and not to screen1.

Quick question Trch -what are all those screens for?

I wouldn't just close the App on Screen1 back pressed, the User could easily do that accidentally. It's better to pop-up a Notifier so that the User can confirm they want to close it.

Still cannot see the need for all those screens. If these are the blocks for Screen1:

then there is no need to go to any other screen, and where is the logic to open another screen ?

For your second set of blocks Button 1 doesn't make any sense, if you are in Screen2, why are you trying to open Screen2?

Which pdf extension are you using ?


I'm sorry I sent the wrong file. These are the Blocks for the application I'm asking about

What screen are "all" those blocks for, Screen2 ? Please help us to help you...

Looking at the extension (PrimePDFViewer) you have a method called Recycle, which resets the pdf viewer. This might be what you are after?

You should still be able to use just one screen to view your pdfs...

Here is an example app using my viewpdf extension and Ulli's Popup extension

ExampleViewMultiplePDFs.aia (53.8 KB)

I will try to explain it to you in another way, maybe you will understand me

Screen1:

This screen features 5 sections (5 buttons). Clicking button 1 will transition to Screen2, clicking button 2 will transition to Screen3, button 3 to Screen4, and so on.

Screen2:

This screen has 7 buttons. Clicking button 1 will open a PDF file and display it via the extension. Clicking button 2 will open another PDF file and display it via the extension, and so on for the remaining buttons.

Desired Functionality:

For example in screen2, when a PDF is displayed and the "BackPressed" button is clicked, the layout displaying the PDF should close, and the visibility of the Screen2 buttons should be reset to the initial view.

If "BackPressed" is clicked again, should be returned to Screen1.

Finally, if "BackPressed" is clicked in Screen1 → the application must be closed.

And so on for the rest of the Screens 3,4,5,6.

If you insist, you will need to understand switching screens.Here is one example:

This might be more inline with what you want (but still only using one screen) ?

ExampleViewMultiplePDFsV2.aia (32.7 KB)

1 Like

Regarding this, for example when I'm on this page and I click on BackPressed