Hello
I want to pass a Map.Values to database.ExecNonQuery2() as second parameter. I thought that should work, because Map.Values resturns a IterableList, but apparently a IterableList and List are 2 different things.
This is my code:
The error that is being logged is: anywheresoftware.b4a.objects.collections.Map$IterableMap cannot be cast to java.util.List
Is there a way to cast this internally?
I could write a Sub that converts it into a list, but how could I accept a IterableList as argument for my function? This doesn't work:
Thanks!
I want to pass a Map.Values to database.ExecNonQuery2() as second parameter. I thought that should work, because Map.Values resturns a IterableList, but apparently a IterableList and List are 2 different things.
This is my code:
B4X:
db.ExecNonQuery2(query, columnMap.Values)
The error that is being logged is: anywheresoftware.b4a.objects.collections.Map$IterableMap cannot be cast to java.util.List
Is there a way to cast this internally?
I could write a Sub that converts it into a list, but how could I accept a IterableList as argument for my function? This doesn't work:
B4X:
Private Sub CastIterableListToList(iterable As IterableList) As List
Dim lst As List
lst.Initialize
For Each s As String In iterable
lst.Add(s)
Next
Return lst
End Sub
Thanks!
Last edited: