Android Question Runtime crash with list of lists

rboeck

Well-Known Member
Licensed User
Longtime User
Currently i cannot find a solution for an release mode problem: i use a list of lists in such style:
B4X:
Dim PolygonPoints2 as list
...
PolygonPoints2.Initialize
PolygonPoints2=mFields.Get(i)

If PolygonPoints2.Size>0 Then
For j=0 To PolygonPoints2.Size-1
...
I can find the crash in java source code here:
if (_polygonpoints2.getSize()>0) {
Message: java.lang.RuntimeException: Object should first be initialized (List).

As we see, the List.Initialize command is three lines before. Why can asking for the size of a list crash the app?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Dim PolygonPoints2 as list
...
PolygonPoints2.Initialize
PolygonPoints2=mFields.Get(i)
You shouldn't initialize the variable if you assign a different object.

There is no problem with having list of lists. mFields.Get returned an uninitialized list or null object.
The problem is in the code that inserts the lists to mFields.

Relevant video tutorial: http://etp.b4x.com/video/253209351
 
Upvote 0
Top