Hi all
how to sort a map from an array?
i created a dialog in which it displays the id and name of the month
here is my code to display month list :
but the results displayed are not in order on iOS but on Android there is no problem
how to sort a map from an array?
i created a dialog in which it displays the id and name of the month
here is my code to display month list :
B4X:
Sub Daftar_Bulan
ListDataPanel = xui.CreatePanel("")
ListDataPanel.SetLayoutAnimated(0, 0, 0, 300dip, 300dip)
ListDataPanel.LoadLayout("ListTemplate") 'ListTemplate is part of XUI Views library.
CustomListView1.sv.SetColorAndBorder(xui.Color_Transparent, 0, 0, 0)
'
Dim cdBulan As Map = CreateMap(1: "Januari", 2: "Februari", 3: "Maret", 4: "April", _
5: "Mei", 6: "Juni", 7: "Juli", 8: "Agustus", _
9: "September", 10: "Oktober", 11: "November", 12: "Desember")
'
For Each bulan As String In cdBulan.Values
Log(bulan)
Next
For Each kode As Int In cdBulan.Keys
Dim bulan As String = cdBulan.Get(kode)
Log($"Kode : ${kode}, bulan : ${bulan}"$)
'
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, ListDataPanel.Width ,50dip)
p.LoadLayout("dialoglsv")
'
lblKey.Text = kode
lblItem.Text = bulan
CustomListView1.Add(p, Array(kode, bulan))
'
Next
End Sub
but the results displayed are not in order on iOS but on Android there is no problem