Try Exception doesn't work properly in Android
Hi, my name is Marcos Maresch and I started few days ago to develop mobile apps with Tokyo.
I'm using tradicional Try... Exception... to handle errors in my apps, but Android simply ignore it.
wsServico := GetIService;
on E: Exception do
Am I doing something wrong or there's another way to handle errors in Firemonkey?
Thanks, regards, Maresch
i think ... there is no error in your code.... check the previous code before the try expression...
Thanks Roger and Robert, I'll try removing the exit and I'll do a simple division by zero test.
I'll tell here what happened.
Are you sure that the exception is being thrown when running your test on Android? This is something (obvious) to check when chasing such an apparently strange behaviour.
What happens if you remove the Exit line?
Note that ShowMessage works different for mobile (Android/iOS): it will not wait for user input, but just run further.
Thanks Alkader, but what happens is that nothing really happen! Android simply ignores the exception handling. The error occurs, but doesn't show the message.
I ran the same code in Win32 environment and, it works!