I have the "Main" activity as my app's activity.
But, I want to display a "Terms and conditions" activity (and it needs to be an activity) right when the main activity is first loaded after installing my app.
And if the user declines my app's ToS, I want to close the app fully.
I was thinking of simply doing this:
So would events happen in the sequence as I am expecting:
1) The main activity will not run most of the activity_create sub and just "chill" while the TOC activity is shown
2) Then after the TOC activity closes itself, the ExitApp routine will run and the app will gracefully close down.
Or will there be some async issues that could be unpredictable with this method?
But, I want to display a "Terms and conditions" activity (and it needs to be an activity) right when the main activity is first loaded after installing my app.
And if the user declines my app's ToS, I want to close the app fully.
I was thinking of simply doing this:
B4X:
'(Main Activity)
Sub Activity_Create (FirstTime as Boolean)
If PrefManager.GetBoolean("TOCAccepted") = False then
StartActvity("toc")
Return
End if
If FirstIime = True
Activity.Loadlayout("main")
End if
'other code here
End Sub
'(this sub is also in the main activity)
Sub ExitApp
Activity.Finish
ExitApplication
End Sub
----------------
'(Then in the TOC activity I would have this code execute if the user declined my TOC)
Sub cmdDecline_Click
CallSubDelayed(main,"exitapp")
Activity.Finish
End Sub
So would events happen in the sequence as I am expecting:
1) The main activity will not run most of the activity_create sub and just "chill" while the TOC activity is shown
2) Then after the TOC activity closes itself, the ExitApp routine will run and the app will gracefully close down.
Or will there be some async issues that could be unpredictable with this method?
Last edited: