Running v5.50 release. I renamed an existing service module to be "Starter". Change the file name on-disk. Open B4A, it complains it can't find old module. I add existing, the renamed file. It loads... all this is fine.
I added to service attributes
In starter I have....
In the MAIN activity I have a button handler....
ok, so then to test. I tried with debug build, and it did not invoke the error handler. In the fog I call my head, I recall something about needing to run a release build, but that also made no difference. In the logcat I can confirm the Application_Error was not called (no logged message). But I do see a pop-up from Android saying the app has stopped. Here is what I see in logcat...
I don't ever see the log entry from Application_Error
Perhaps the way I renamed this service module to Starter, rather than creating one from scratch is at issue? I was under the impression the module name alone was all that was needed. Perhaps it doesn't catch the kind of exception I forced?
I added to service attributes
B4X:
#Region Service Attributes
#StartAtBoot: False
#ExcludeFromLibrary: True
#End Region
In starter I have....
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
ETC....
End Sub
Sub Service_Create
Log("at Starter.Service_Create")
ETC....
End Sub
Sub Service_Start (StartingIntent As Intent)
Log("at Starter.Service_Start")
logcat.LogCatStart(Array As String(),"logcat")
'lower cased module name
NativeMe.InitializeStatic(Application.PackageName & ".starter")
End Sub
Sub Service_Destroy
Log("at Starter.Service_Destroy")
ETC.........
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Log("at Starter.Application_Error")
ETC....
Return True
End Sub
In the MAIN activity I have a button handler....
B4X:
Sub btnTest_Click
Log("at Main.btnTest_Click")
Dim i As Int
i = "sdf"
End Sub
ok, so then to test. I tried with debug build, and it did not invoke the error handler. In the fog I call my head, I recall something about needing to run a release build, but that also made no difference. In the logcat I can confirm the Application_Error was not called (no logged message). But I do see a pop-up from Android saying the app has stopped. Here is what I see in logcat...
PackageAdded: packagedp.eljaydelivery
etc.
at Starter.Service_Create
etc.
at Starter.Service_Start
etc.
at Main.Activity_Create
etc.
at Main.Activity_Resume
etc.
at Starter.Service_Destroy
etc.
at Main.btnTest_Click
main_btntest_click (java line: 529)
java.lang.NumberFormatException: Invalid double: "sdf"
etc.
main_btntest_click (java line: 529)
java.lang.NumberFormatException: Invalid double: "sdf"
etc.
I don't ever see the log entry from Application_Error
Perhaps the way I renamed this service module to Starter, rather than creating one from scratch is at issue? I was under the impression the module name alone was all that was needed. Perhaps it doesn't catch the kind of exception I forced?