Hello,
I'm having 2 issues with customlistview.
First of all, this is the code:
The first error is the following, and only happens when I execute in debug mode:
The second error, when executed in release mode, the app runs but crashes:
I'm having 2 issues with customlistview.
First of all, this is the code:
B4X:
Sub Globals
Private clvLista As CustomListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("layMain")
Dim i As Int
For i = 1 To 5
clvLista.add(CreateListItem, "")
Next
End Sub
Sub CreateListItem() As B4XView
Dim p As B4XView
P = xui.CreatePanel("")
P.SetLayoutAnimated(0,0,0,100%x,100%y)
p.LoadLayout("layItem")
Return p
End Sub
The first error is the following, and only happens when I execute in debug mode:
B4A Version: 8.00
Parsing code. (0.05s)
Compiling code. Error
Error compiling program.
Error description: Too many parameters.
Error occurred on line: 46
clvLista.add(CreateListItem,"")
Word:
The second error, when executed in release mode, the app runs but crashes:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 345)
java.lang.RuntimeException: java.lang.RuntimeException: Field clvlista was declared with the wrong type.
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at b4a.example.main._activity_create(main.java:345)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.RuntimeException: Field clvlista was declared with the wrong type.
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:431)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 14 more