Android Question Sub timerdevice_tick

PdeG

Member
Licensed User
Longtime User
I get this error when running my app in release mode, debug mode runs without error

B4X:
java.lang.Exception: Sub timerdevice_tick was not found.
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
    at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7397)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

but the sub exists in the class i'm using

B4X:
Sub Class_Globals
    Public TimeGetDevice As Timer
End Sub

Public Sub Initialize(callingActivity As String)
    act = callingActivity
    TimeGetDevice.Initialize("timerDevice", 12000)
End Sub

public Sub timerDevice_Tick
    starter.timeElapsed = True   
End Sub

Something i'm overlooking?

Regards,
Peter
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
Something i'm overlooking?
The general advice is to declare timers in Process Globals. If you declare them elsewhere then you risk creating multiple copies and getting the sort of situation that you describe. Not sure if this is your problem without seeing more code.
 
Upvote 0

PdeG

Member
Licensed User
Longtime User
Sorry for the late response, I think something was corrupted in my project folder, I deleted the project and did a fresh clone from GitHub and the error disappeared.

Thanks for the replies.

Regards,
Peter
 
Upvote 0
Top