Hi,
I have looked everywhere on the forum but could not find the answer because it is working just perfectly well in the example by Erel at https://www.b4x.com/android/forum/threads/b4x-xui-cross-platform-native-ui-library.84359/
I have following code
and I am getting following error.
I know i must be missing something very trivial but am not able to find the issue.
Note: Code works perfectly well if i use the for Each loop
Thanks in advance
I have looked everywhere on the forum but could not find the answer because it is working just perfectly well in the example by Erel at https://www.b4x.com/android/forum/threads/b4x-xui-cross-platform-native-ui-library.84359/
I have following code
B4X:
Sub chkSelect_CheckedChange(Checked As Boolean)
Dim index As Int= clvPlayerFav.GetItemFromView(Sender)
Dim pnl As B4XView= clvPlayerFav.GetPanel(index)
lstSelectedPlayers.Add(pnl.GetView(1).Tag)
End Sub
and I am getting following error.
I know i must be missing something very trivial but am not able to find the issue.
Note: Code works perfectly well if i use the for Each loop
B4X:
For Each v As B4XView In pnl.GetAllViewsRecursive
B4X:
actplayerlist_chkselect_checkedchange (java line: 475)
java.lang.RuntimeException: Object should first be initialized (View).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.B4XViewWrapper.GetView(B4XViewWrapper.java:237)
at com.jakes.kgscorecard.actplayerlist._chkselect_checkedchange(actplayerlist.java:475)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.objects.CompoundButtonWrapper$1.onCheckedChanged(CompoundButtonWrapper.java:44)
at android.widget.CompoundButton.setChecked(CompoundButton.java:157)
at android.widget.CompoundButton.toggle(CompoundButton.java:116)
at android.widget.CompoundButton.performClick(CompoundButton.java:121)
at android.view.View$PerformClick.run(View.java:22473)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Thanks in advance