Hi, I can't seem to figure this one out:
I have these players and timer in:
The varible
is accessible in other subs, but not in CstmTimerForPlay_Tick, this is the second global variable I have the same problem with - the previous was array of ints. Normal global ints seem to be working fine. It seems that this behavior is only for arrays?
The array itself is declared, but doesn't have any values - isn't even initialized in the case of maps.
I do this:
And then when I try
in CstmTimerForPlay_Tick it gives an error:
main_cstmtimerforplay_tick (java line: 987)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Object.equals(java.lang.Object)' on a null object reference
at com.promoTV.main._cstmtimerforplay_tick(main.java:987)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
The players work fine and play well when I play it from any other sub, using the same number #i with that value that doesn't work in the timer - I checked.
Please help, thank you,
Kind regards,
Marko
I have these players and timer in:
B4X:
Sub Process_Globals
Public PlayersArray(50) As SimpleExoPlayer
Public CstmTimerForPlay As Timer
The varible
B4X:
PlayersArray(i)
The array itself is declared, but doesn't have any values - isn't even initialized in the case of maps.
I do this:
B4X:
CstmTimerForPlay.Initialize("CstmTimerForPlay",100)
CstmTimerForPlay.Enabled = True
And then when I try
B4X:
PlayersArray(i).Play
main_cstmtimerforplay_tick (java line: 987)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Object.equals(java.lang.Object)' on a null object reference
at com.promoTV.main._cstmtimerforplay_tick(main.java:987)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
The players work fine and play well when I play it from any other sub, using the same number #i with that value that doesn't work in the timer - I checked.
Please help, thank you,
Kind regards,
Marko