Sub Process_Globals
Public ISOCountryCodes As List
Public Country As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
ISOCountryCodes.Initialize
Country.Initialize
GetCountryNames
End Sub
Sub GetCountryNames
Dim jo As JavaObject
Dim ISOCodes() As String
jo.InitializeStatic("java.util.Locale")
ISOCodes = jo.RunMethod("getISOCountries", Null)
ISOCountryCodes.AddAll(ISOCodes)
' Dim jo2 As JavaObject
' jo2.InitializeNewInstance("java.util.Locale", Array As Object("en", "US"))
' jo.RunMethod("setDefault", Array As Object(jo2))
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