My app crashes after working some time. I couldn't find why it crashes. Is there anyone who can help me? I can send my app.
Is there anyone who can help me? I can send my app.
#BridgeLogger: True
SetApplicationAttribute(android:largeHeap,"true")
Where should I write #BridgeLogger: True ?
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#BridgeLogger: True
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub BtnSystemOnOff_CheckedChange(Checked As Boolean)
If TextFieldimei.Text.Length = 15 Then
If Starter.GPS1.GPSEnabled = True Then
If BtnSystemOnOff.Checked = True Then
BtnSystemOnOff.Color = Colors.Green
systemon = True
StartService(Starter)
Event = ""
Else
BtnSystemOnOff.Color = Colors.Red
systemon = False
StopService(Starter)
End If
Else
Msgbox(lblgpstextdisable, warningtitle1)
End If
Else
Msgbox(warning1, warningtitle1)
End If
End Sub
StartServiceAt("", DateTime.Now + 6 * DateTime.TicksPerSecond, True)
I made this error just a few months ago, so I have learnt this rule by myself: never "disturb" a running Starter service!
Dont start or Stop the starter-Service. Most probably you should use another service if you need to restart/start/stop itHow did you solve this problem?
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt(Starter, DateTime.Now + 6 * DateTime.TicksPerSecond, True)
End Sub
Sub Service_Destroy
End Sub
ub BtnSystemOnOff_CheckedChange(Checked As Boolean)
If TextFieldimei.Text.Length = 15 Then
If Starter.GPS1.GPSEnabled = True Then
If BtnSystemOnOff.Checked = True Then
BtnSystemOnOff.Color = Colors.Green
systemon = True
StartService(Starter2)
Event = ""
Else
BtnSystemOnOff.Color = Colors.Red
systemon = False
StopService(Starter2)
End If
Else
Msgbox(lblgpstextdisable, warningtitle1)
End If
Else
Msgbox(warning1, warningtitle1)
End If
End Sub