knutf Active Member Licensed User Longtime User Aug 24, 2020 #1 This code cause a exception: B4X: Dim itms As Map = CreateMap("item1":"value1","item2":"value2","item3":"value3") ComboBox1.Items.AddAll(itms.Keys) java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map$IterableMap cannot be cast to java.util.List Click to expand... Is this the best solution?: B4X: Dim itms As Map = CreateMap("item1":"value1","item2":"value2","item3":"value3") For Each key In itms.Keys ComboBox1.Items.Add(key) Next
This code cause a exception: B4X: Dim itms As Map = CreateMap("item1":"value1","item2":"value2","item3":"value3") ComboBox1.Items.AddAll(itms.Keys) java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map$IterableMap cannot be cast to java.util.List Click to expand... Is this the best solution?: B4X: Dim itms As Map = CreateMap("item1":"value1","item2":"value2","item3":"value3") For Each key In itms.Keys ComboBox1.Items.Add(key) Next
Erel B4X founder Staff member Licensed User Longtime User Aug 25, 2020 #2 knutf said: Is this the best solution?: Click to expand... Yes. Upvote 0