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.
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?
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.
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.
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.