B4J Question Adding a value to a list results in a UnsupportedOperationException

MathiasM

Active Member
Licensed User
Hello

I try to add a value to a list, but I get a java.lang.UnsupportedOperationException when I try to do this.
Why is this not working?

B4X:
Sub AppStart (Args() As String)
    TestList("Third", Array As String("First", "Second"))
End Sub

Sub TestList(NewValue As String, PreviousList As List)
    Dim NewList As List
    NewList.Initialize2(PreviousList)
    NewList.Add(NewValue)
End Sub

Thanks!
 
Top