Is it a bug or not:
This has been reported before: http://www.b4x.com/forum/basic4andr...sic4android-v2-00-released-10.html#post111542
And is related to the problem i posted about here: http://www.b4x.com/forum/libraries-...71-passing-b4a-list-arraylist.html#post135851
A List created with the Initialize2 method does not have the same behaviour or type as a list created with the Initialize method.
Martin.
B4X:
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim MyList As List
MyList.Initialize2(Array As Int(1, 20, 14, 9))
MyList.Clear
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 233)
java.lang.UnsupportedOperationException
at java.util.AbstractList.remove(AbstractList.java:645)
at java.util.AbstractList$SimpleListIterator.remove(AbstractList.java:77)
at java.util.AbstractList.removeRange(AbstractList.java:665)
at java.util.AbstractList.clear(AbstractList.java:473)
at anywheresoftware.b4a.objects.collections.List.Clear(List.java:68)
at b4a.example.main._activity_create(main.java:233)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165)
at b4a.example.main.afterFirstLayout(main.java:84)
at b4a.example.main.access$100(main.java:16)
at b4a.example.main$WaitForLayout.run(main.java:72)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3835)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
java.lang.UnsupportedOperationException
This has been reported before: http://www.b4x.com/forum/basic4andr...sic4android-v2-00-released-10.html#post111542
And is related to the problem i posted about here: http://www.b4x.com/forum/libraries-...71-passing-b4a-list-arraylist.html#post135851
A List created with the Initialize2 method does not have the same behaviour or type as a list created with the Initialize method.
Martin.