Sub Activity_Create(FirstTime As Boolean)
DateTime.DateFormat = "dd/MM/yyyy"
DateTime.TimeFormat = "HH:mm"
Log($"Date/time: $Date{DateTime.Now} $Time{DateTime.Now}"$)
'counter to update native ad
GlobalTimeSetWhenStopperWasStarted = DateTime.Now
SetDefaults 'create preferences
'show tip in the first open
If Starter.manager.GetBoolean("tip001") = False Then
StartActivity(abertura)
Starter.manager.SetBoolean("tip001", True)
Sleep(0)
End If
Try
billman3.Initialize("billman3", chv)
billman3.DebugLogging = False
Catch
Log(LastException)
ToastMessageShow("Error to check In-App", False)
End Try
NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)
actual_hour = DateTime.GetHour(DateTime.Now)
actual_min = DateTime.GetMinute(DateTime.Now)
'splash screen
Try
Activity.LoadLayout("splash1")
ivLogo.SetVisibleAnimated(800, True)
AnimPlus.InitializeTranslate("Anim0", 0, 110dip, 0, 0)
AnimPlus.SetInterpolator(AnimPlus.INTERPOLATOR_DECELERATE)
AnimPlus.StartOffset = 0
AnimPlus.Duration = 1400
AnimPlus.PersistAfter = True
AnimPlus.Start(ivProfile)
Catch
If LastException.IsInitialized Then Log(LastException.Message) '<===== HERE IS THE LINE OF ERROR SHOW IN FIREBASE CRASHLITYCS
End Try
'record open date/hour + last access
Dim fVal As Map
fVal.Initialize 'inicializa mapa
Try
If Funcoes.ExistsValueDB("diary", "data", Funcoes.GetDefaultDateFormat(DateTime.Date(DateTime.Now))) = False Then
Dim ListOfMaps As List
ListOfMaps.Initialize
fVal.Put("date", Funcoes.GetDefaultDateFormat(DateTime.Date(DateTime.Now)))
fVal.Put("hour", DateTime.Time(DateTime.Now))
ListOfMaps.Add(fVal)
DBUtils.InsertMaps(Starter.SQL1, "diary", ListOfMaps)
End If
Catch
Log(LastException.Message)
End Try
Counter = 0
'initialize timers
Timer1.Initialize("Timer1", 70)
TimerMsg.Initialize("TimerMsg", 400)
Sleep(1000)
CreateMainScreen 'call sub to create the main screen
End Sub
Sub Activity_Resume
Starter.running = True
updated = False
'*** notification
Dim in As Intent
Try
in = Activity.GetStartingIntent
If in.IsInitialized And in.HasExtra("Notification_Tag") Then
notifica = True
Select Starter.momento
Case 2 'night
If Funcoes.CheckConnection = True Then Starter.analytics.SendEvent("Notifica_Night", Null)
Case 1 'evening
If Funcoes.CheckConnection = True Then Starter.analytics.SendEvent("Notifica_Evening", Null)
Case Else
If Funcoes.CheckConnection = True Then Starter.analytics.SendEvent("Notifica_Morning", Null)
End Select
End If
Catch
Log(LastException)
End Try
If Starter.free = False Then 'only show ad in the free version
If Starter.ShowAd = True Then ShowAd
'update native ads
CheckAds
End If
If TTS1.IsInitialized = False Then
TTS1.Initialize("TTS1")
TTS1.SpeechRate = 0.9
End If
If AdView1.IsInitialized Then AdView1.Resume
End Sub
Sub CreateMainScreen
pSplash.Visible = False
'check screen sizes
If GetDeviceLayoutValues.ApproximateScreenSize > 6.5 Then
'tablets
iheight = 92dip
IsTablet = True
Else
'phones
iheight = 52dip
IsTablet = False
End If
'load main layout
Activity.LoadLayout("main0")
'load main layout 2 inside scrollview
scv1.Panel.LoadLayout("main1")
'create actionbar
AB.Initialize(pnlAB, True, False, pnlAB.height, False, Me)
Create_ActionBar
CreateMenu
(....)
End sub