I am using vertical arrangements to simulate different screens. Attempting to use the Device Back Button to call the WEBVIEWER.GOBACK to display previous sites.
Hello. I have created an app for my kids’ soccer club. I am practically using this app as a web browser for the soccer club’s website. I created a horizontal arrangement (placed at the top of the screen) with buttons for each of the web page’s tabs. When I click on any of the buttons, a PROCEDURE that hides all of the buttons and web viewers is activated, and only the desired button and web viewer are displayed. The code as is works beautifully as intended.
However, when I press the DEVICE’S BACK BUTTON, the app closes. What I would like to happen is for the app to reset the web viewer to previous sites viewed. After doing some research, it appears that the best solution for my situation is to use the “WHEN SCREEN1. BACKPRESSED” block. However, I don’t know how to properly set these up (IMAGE 3). Any help would be greatly appreciate it.
Hello Chris. Since the web viewers display pages that are rather long, I tried to stay away from inserting buttons that users would need to scroll down to find. I am interested in your “text comparison of the actual urls” solution to this. How would it look like given that I am using 16 different WEB VIEWERS?
I thought each web viewer has to be assigned its HOME URL. What I did was create 16 vertical arrangements that include a Web Viewer. When the button for HOME is pressed, the HOME VERTICAL ARRANGEMENT becomes visible (which includes the web viewer with its assigned URL) and the other 15 VERTICAL ARRANGEMENTS are hidden. When the button for CONTACT US is pressed, the CONTACT US VERTICAL ARRANGEMENT becomes visible (which includes the web viewer with its assigned URL) and the other 15 VERTICAL ARRANGEMENTS are hidden. Maybe there is an easier way to do this, but that’s what I came up with. Is there a better way of doing this?
Thank you Chris and Ken, after reading both of your responses, I completely abandoned my original blocks with a bunch of vertical arrangements and web viewers, which simplified my code. Now, I am only using one WebViewer with one Vertical Arrangement. With this set up I was able to apply your recommended “When Screen1.BackPressed” block with the recommended “Compare Texts” and “Call WebViewer1.GoBack” blocks. It now works exactly how I wanted it to work. Thank you very much! I learned a lot!