how to access Application.OnException from inside a service?


Inside my android service i would like to have a procedure to catch all unhandled exception. In app we do like this :

Application.OnException := MyExceptionCatcher;

However using Application.OnException inside a service require to include fmx.forms, and this will drastically increase the size of the .so (10x more bigger!)

how can i do ?

Also it’s a very big mister for me, because doing

Application.OnException := MyExceptionCatcher

work perfectly, error is catch in MyExceptionCatcher (but we need to include fmx.forms that is not acceptable). But doing

System.Classes.ApplicationHandleException := MyExceptionCatcher

not work at all 🙁

Comments are closed.