i started to use B4A 9.01 and i opened my old projects with it,
and i unchecked CustomListView from the lib and checked the xCustomListView
every thing was alright except my (clv.add) and (clv2.insertat)
and gives the following error
i'd like to note that i downloaded b4a example of (xCustomListView) it works fine
and also im did not add the module (CustomListView.bas) to the project
i hope to find answer after tow days searching in similar problems in B4A forum?
and i unchecked CustomListView from the lib and checked the xCustomListView
every thing was alright except my (clv.add) and (clv2.insertat)
and gives the following error
and the line of code witch rise that error ismain_add1tolist (java line: 1068)
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.res.ColorStateList.getDefaultColor()' on a null object reference
at anywheresoftware.b4a.objects.B4XViewWrapper.getColor(B4XViewWrapper.java:399)
at b4a.example3.customlistview._insertatimpl(customlistview.java:553)
at b4a.example3.customlistview._insertat(customlistview.java:535)
at cccb.com.main._add1tolist(main.java:1068)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1179)
at android.os.Handler.handleCallback(Unknown Source:2)
at android.os.Handler.dispatchMessage(Unknown Source:4)
at android.os.Looper.loop(Unknown Source:155)
at android.app.ActivityThread.main(Unknown Source:65)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11)
at com.android.internal.os.ZygoteInit.main(Unknown Source:345)
B4X:
clv2.InsertAt(0,CreateListItem("dd",clv2.AsView.Width, 60dip), $"Item !!!"$)
''''''''''''''''''''''' creat panel function''''''''''''''''''''''''''
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.SetLayout(0, 0, Width, Height)
p.LoadLayout("cellitem2")
Label1.Text = Text
Return p
End Sub
i'd like to note that i downloaded b4a example of (xCustomListView) it works fine
and also im did not add the module (CustomListView.bas) to the project
i hope to find answer after tow days searching in similar problems in B4A forum?
Last edited: