Hello,
I am trying to load some simple text in customlistview. I have added the below references
1. XUI
2. StringsUtils
3. Add the module customlistview.bas
I am following the Erel Example and trying to do:
https://www.b4x.com/android/forum/t...-cross-platform-customlistview.84501/#content
But while compiling I am getting the below error and redirecting to customlistview.bas:
Below is my code
I am trying to load some simple text in customlistview. I have added the below references
1. XUI
2. StringsUtils
3. Add the module customlistview.bas
I am following the Erel Example and trying to do:
https://www.b4x.com/android/forum/t...-cross-platform-customlistview.84501/#content
But while compiling I am getting the below error and redirecting to customlistview.bas:
B4X:
Parsing code. Error
Error parsing program.
Error description: Unknown type: javaobject
Are you missing a library reference?
Error occurred on line: 88 (CustomListView)
Dim jsv As JavaObject = sv
Below is my code
B4X:
#Region Project Attributes
#ApplicationLabel: CustomListView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private CLV1 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("Main")
CLV1.DefaultTextBackgroundColor=Colors.Gray
For i = 0 To 10
CLV1.Add(createItem("Item #" & i,CLV1.AsView.Width,40dip),i)
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
private Sub createItem(Text As String,width As Int,height As Int) As B4XView
Dim p As B4XView=xui.CreatePanel("")
p.SetLayoutAnimated(0,0,0,100%x,10%x)
p.Color=Colors.Blue
Return p
End Sub