How do you reset FirstTime ?

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

In my code I tried to reset FirstTime but it stayed in a False state.

Can you tell me how to reset it to True when leaving the app?

B4X:
Sub Activity_Create(FirstTime As Boolean)

   ' Set view locations and set defaults.
   '-------------------------------------
   Activity.LoadLayout("main")
   Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "balloons.png"))

   Utils.CenterView(PanelSplashScreen, Activity)
   Utils.CenterView(PanelMain, Activity)

   If FirstTime Then
      PanelSplashScreen.Visible = True
      PanelMain.Visible = False

      tmrSplashScreen.Initialize("tmrSplashScreen", 5000)
      tmrSplashScreen.Enabled = True
   Else
      PanelSplashScreen.Visible = False
      PanelMain.Visible = True
   End If

End Sub

Sub ButtonClose_Click
   
   FirstTime = False
   
   Activity.Finish
End Sub

I would like to display the splash screen and when the splash screen disappears the main menu is displayed every time the app is started. The splash screen and the main menu are on the same layout file.

Currently the splash screen is displayed for 5 seconds then the main menu is displayed. If the user changes the orientation of the phone the main menu is still shown. If I exit the app with Activity.Finish and start it up again the main menu is displayed and not the splash screen.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…