iOS Question Back Button and activity resume

Discussion in 'iOS Questions' started by Marco Maria Vilucchi, Jul 14, 2015.

  1. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    when i press "back" the App return to main page.
    On Android i can use Activity_Resume.
    How can i intercept "back" button pression on B4I?
    Can someone help me?


    Attached Files:

  2. imbault

    imbault Well-Known Member Licensed User

    There must be several methods, the one I have used is working with variables, let's say LastPage for saving lastpage and Pb used in all pages
    So in main
    Sub Process_Globals
    Private LastPage="" As String
    Public Pb ="" as String
    Private HomeScreen As Page
    Private Sub Application_Start (Nav As NavigationController)
    Let's say your main page calls a Parameter page, before calling, just do:
    LastPage = "parameters"
    In Parameter, you can intercept the page is going to "back" in this Sub Page_Disappear , and saving what you want before page really disappears:
    Private Sub parameters_Disappear
    If PwrM <= PwrL Then
            Main.Pb = Main.Pb  & 
    "Warning PowerM Should be Greater than PowerL" & CRLF
    End If

    In Main, a Sub will be raises, Page_Appear, here you can check the LastPage and pb

    Private Sub HomePage_Appear
    If LastPage <> "" Then
    ' handle saves
            If LastPage = "parameters" Then
    If Pb <> "" Then
    Msgbox(Pb,"Please fix errors in Parameters")
                    Pb = 
    End If
    End If

            LastPage = 
    End If

    End Sub
    Hope this will show you how to do
    Last edited: Jul 14, 2015
  3. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Seems complicated but i try......
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice