Android Question [Solved] Uncaught Exceptions with a dialog

asales

Expert
Licensed User
Longtime User
I try to show a dialog in sub "Application_Error" of Starter Service like suggest by this post:
https://www.b4x.com/android/forum/threads/uncaught-exceptions.59805/page-2#post-389197

but don't work.
The dialog is showing "after" the intent to send email raises.
How I can show the dialog "before" the intent to send email raises and how I can start the intent only if the user click in the Send button in the dialog?

This is my code:

B4X:
(Starter):
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    (...)

    email.Body = logs

    StartActivity(msgerro)
   
    StartActivity(email.GetIntent)

    Return True
End Sub

(Activity MyErrorDialog):
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")

      Dim Answ As Int

    Dim id As InputDialog
 
    Answ = id.Show("Please, send an e-mail to our support.", "Program crashed", "Send", "Cancel", "", Null)
   
      If Answ = DialogResponse.POSITIVE Then
        '?? How to start the intent to send email in "application_error" only if DialogResponse = Positive ??
    End If
   
End Sub

Thanks in advance for any tip.
 
Top