type with list = null error

fabioferreiracs

Member
Licensed User
Longtime User
see this code :

in main activity ( Process_Globals) :

B4X:
Type twostrings ( seq as int, name as string , listaEntidades as list)

dim ts(20) as twostrings

in service module :

B4X:
dim myList as list
myList.initialize
myList.add ("one" )
myList.add ("two" )


main.ts(0).seq = 10
main.ts(0).name = "name1"
main.ts(0).listaEntidades = myList  "ERROR JAVA NULL POINT EXCEPTION "

so I try in service module:

B4X:
dim myList as list
myList.initialize
myList.add ("one" )
myList.add ("two" )

dim arraypivo (myList.size)
for k = 0 to myList.size - 1
     arraypivo(k) = myList.get(k)
next

main.ts(0).listaEntidades.addall (arraypivo) "ERROR JAVA NULL POINT EXCEPTION "

in both cases i see :
B4X:
log("main.ts(0).listaEntidades: " & main.ts(0).listaEntidades)

main.ts(0).listaEntidades: null

what is happening ?

Thanks
 
Top