Sub Globals
Dim lblWoord() As Label
End Sub
Sub Activity_Create
'When you Know how many there are
Dim Count As Int = 10
Dim lblWoord(Count) As Label 'still a global variable
For i = 0 To Count-1
Dim L As Label
L.Initialize("lblWoord")
L.TextColor = Colors.black
L.TextSize = 16
L.Left=0
L.Tag = i
lblWoord(i) = L
Next
For Each L As Label In lblWoord
Log(L.Tag)
Next
End Sub
When the statement L.Left=0 is executed this error is reported in the log:
main_gps_gpsstatus (B4A line: 356)
L.Left=0
java.lang.NullPointerException
at anywheresoftware.b4a.objects.ViewWrapper.setLeft(ViewWrapper.java:156)
at raccolta.rifiuti.com.main._gps_gpsstatus(main.java:1739)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.gps.GPS$2.onGpsStatusChanged(GPS.java:99)
at android.location.LocationManager$GpsStatusListenerTransport$1.handleMessage(LocationManager.java:1468)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
Please help me for resolve this problem.
Thanks.