I looked at my Google Crashes and ANRs and saw this entry
The ONLY service I have in my app is the Start Service.
I am not getting a lot of these crashes but some device must be having them.
NOT sure how to fix this. Below is a copy of my Starter
BobVal
The ONLY service I have in my app is the Start Service.
I am not getting a lot of these crashes but some device must be having them.
NOT sure how to fix this. Below is a copy of my Starter
BobVal
Starter:
#Region Service Attributes
#StartAtBoot: False
#ExcludeFromLibrary: True
#End Region
Sub Process_Globals
Private logs As StringBuilder
Private logcat As LogCat
' Private mIsConnectedCalled As Boolean = False
' Private mConnected As Boolean = False
End Sub
Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
LogColor("Service_Create", Colors.Magenta)
' If IsDeviceFoldable = False Then
' End If
#if NeedServiceReceiver
If HttpUtils2Service.TempFolder = "" Then
Dim jo As JavaObject
jo.InitializeNewInstance(Application.PackageName & ".httputils2service", Null)
jo.RunMethod("onReceive", Array(Null, Null))
End If
#end if
End Sub
Sub Service_Start (StartingIntent As Intent)
' Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
logs.Initialize
logcat.LogCatStart(Array As String("-v","raw","*:F","B4A:v"), "logcat")
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Private Sub logcat_LogCatData (Buffer() As Byte, Length As Int)
logs.Append(BytesToString(Buffer, 0, Length, "utf8"))
If logs.Length > 5000 Then
logs.Remove(0, logs.Length - 4000)
End If
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Public Sub Application_Error(Error As Exception, StackTrace As String) As Boolean
LogColor($"Starter::Application_Error - Error:${Error.Message}"$, Colors.Red)
return true
End Sub
Sub Service_Destroy
End Sub