Android Question java.lang.Exception:

D

Deleted member 103

Guest
Hello,

This crash happens too often in Google Report, and I do not know where that comes from.
It would be nice if someone could help here. :)

Main-Code:

B4X:
Sub Activity_Create(FirstTime As Boolean)
...
    If FirstTime = True Then
                      
       ClockTimer.Initialize("ClockTimer", 100)
    End If

    ClockTimer.Enabled = True
...
End Sub

Sub ClockTimer_Tick
    Dim time As Long
    Dim IntervalFirst As Double
    Dim DistanceTheoretically As Double
    time = DateTime.Now - (Starter.lngTimer + Starter.lngSecGpsToFunk)

    dClock.Text = DateTime.time(time)

    If Starter.intClockSelected > -1 Then

        ...
        ...
                
    End If

    ShowSpeed(time)
    
    ShowAutoStart(time)
End Sub

Public Sub ShowAutoStart(time As Long)
    If pnlAutoStart.Visible Then
        Dim h, m, S As Int
        h = DateTime.GetHour(time)
        m = DateTime.GetMinute(time)
        S = DateTime.GetSecond(time)
        time = (S * DateTime.TicksPerSecond) + (m * DateTime.TicksPerMinute) + (h * DateTime.TicksPerHour)
        lblTime.Text = mBBL.getConvertTickToHHmmss(lblTime.Tag - time)

        Dim t As Int = (lblTime.Tag - time) / DateTime.TicksPerSecond
        If t <= 10 And Starter.Autostarttime <> t Then
            Starter.Autostarttime = t
            If t > 0 Then
                If Starter.IsSpeech Then
                    CallSub2(Starter,"Start_Speech", t)
                Else
                    CallSub(Starter,"Start_beep200")
                End If
            Else If t = 0 Then
                CallSub(Starter,"Start_beep500")
            End If
        End If

        If (lblTime.Tag - time) <= 0 Then
            btnCancel_Click
        End If
    End If
End Sub

Starter-Service:
B4X:
Public Sub Start_Speech(number As Int, lastBeep As Int)
    Dim firstbeep As Int = Min(10, lastBeep)
    If IsSpeechAllNumbers Then
        If number <= 10 Then 'Nur die letzte 10 sekunden werden als Sprache gesendet.
            'Log("1.Speech=" & number)
            If IsTTSReady Then
                TTS1.Speak(number, True)
            Else
                mplay(number).Play
            End If
        Else
            Start_beep200
        End If
    Else
        If number = firstbeep Then 'Nur die erste Zahl soll gesprochen.
            'Log("2.Speech=" & number)
            If IsTTSReady Then
                TTS1.Speak(number, True)
            Else
                mplay(number).Play
            End If
        Else
            Start_beep200
        End If
    End If
End Sub

Private Sub Start_beep200
    'Log("b200.Beep")
    b200.beep
End Sub

Private Sub Start_beep500
    'Log("b500.Beep")
    'Log(" ")
    b500.beep
End Sub


crash report:
vor 13 Minuten in der App-Version 25
Samsung Galaxy A5(2017) (a5y17lte), Android 8.0
Bericht 1 von 11
java.lang.Exception
:
at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:193)
at anywheresoftware.b4a.keywords.Common.CallSub4 (Common.java:1058)
at anywheresoftware.b4a.keywords.Common.CallSubNew2 (Common.java:1013)
at fg.MasterOfRegolarity.main._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv6 (main.java:3504)
at fg.MasterOfRegolarity.main._clocktimer_tick (main.java:1714)
at java.lang.reflect.Method.invoke (Native Method)
at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:191)
at anywheresoftware.b4a.objects.Timer$TickTack.run (Timer.java:105)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6944)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

upload_2018-10-23_11-36-57.png


upload_2018-10-23_11-26-18.png


upload_2018-10-23_11-26-57.png
 
D

Deleted member 103

Guest
Are you pausing the timer when the activity is paused?
Yes, I always do that.
B4X:
Sub Activity_Resume
    'Log("Activity_Resume")
    ClockTimer.Enabled = True
...
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    'Log("Activity_Pause UserClosed=" & UserClosed)
    ClockTimer.Enabled = False
...
End Sub
 
Upvote 0
D

Deleted member 103

Guest
I think that the real error message is missing here. It probably happens in Start_Speech. Worth integrating Crashlytics. It will hopefully provide more information.
Thank you, then I have to try that.
 
Upvote 0
D

Deleted member 103

Guest
Thanks to Crashlytics, and of course Erel, I have now found the mistake.

The sub "Start_Speech" has 2 parameters, I started it with 1 paramter. :(

B4X:
CallSub2(Starter,"Start_Speech", t)
 
Upvote 0
Top