Android Question Hide MainPage - wich command ?

dd1

Member
I'm building an app for Android to receive sms, decode messages and send sms with response, without the need for operator intervention
Main modules (code), Starter (service), B4xPage (class module), Sms (service)
When app start, MainPage is displayed
There is only the MainPage that I am using as a program configuration
When the app starts, the setup screen is shown
Once the configuration is complete I would like to have a button 'HIDE' to close the MainPage and put the program in 'listening' mode
What command to use to hide the MainPage?
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Put all your communication code in a service and start that service, before closing the MainPage configuration.
 

Attachments

  • hideMainPage.zip
    10.3 KB · Views: 216
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Yes that works too. I thought closing the MainPage would kill the process, but as you have pointed out many times, only the OS has the license to kill.

B4X:
Sub Button1_Click
    xui.MsgboxAsync("Hello world!", "B4X")
    startLogging
    B4XPages.ClosePage(Me)
End Sub

Private Sub startLogging
    For i = 0 To 10
        Log("I am still alive")
        Sleep(1000)
    Next
End Sub
 
Upvote 0
Top