Hi,
I am trying to load all the country's into a list.
In B4A I used the following code but of cause it don't work with B4i.
Is there a way in doing the following in b4i ?
I am trying to load all the country's into a list.
In B4A I used the following code but of cause it don't work with B4i.
Is there a way in doing the following in b4i ?
B4X:
Sub GetCountryNames
Dim jo As JavaObject
Dim ISOCodes() As String
jo.InitializeStatic("java.util.Locale")
ISOCodes = jo.RunMethod("getISOCountries", Null)
ISOCountryCodes.AddAll(ISOCodes)
Country.Clear
For i = 0 To ISOCountryCodes.Size - 1
Dim jo1 As JavaObject
jo1.InitializeNewInstance("java.util.Locale", Array As Object("en", ISOCountryCodes.Get(i)))
Dim str0, str(2) As String
str0 = jo1.RunMethod("getDisplayName", Null)
str = Regex.Split("[(]", str0)
Country.Add(str(1).Replace(")", ""))
Next
End Sub