Lists, what am I doing wrong?

joofville

Member
Licensed User
Longtime User
Hey guys.

I am getting the following error when working with Lists, here's an example

B4X:
Sub Globals
   Dim mainList As List
End Sub

Sub Activity_Create(FirstTime As Boolean)
   mainList.Initialize
   mainList = GetMyData
End Sub

Sub GetMyData
   Dim workList as List
   workList.Initialize
   workList.Add("Hello")
   return workList
End Sub

This is the error ??

Parsing code. 0.01
Compiling code. 0.05
Compiling layouts code. 0.01
Generating R file. 0.49
Compiling generated Java code. Error
B4A line: 53
mainList = GetMyData
javac 1.7.0_05
src\b4a\example\main.java:276: error: inconvertible types
mostCurrent._mainchannels.setObject((java.util.List)(mostCurrent._dbstuff._getchannels(mostCurrent.activityBA)));
^
required: List
found: String
 
Top