Skip to content

Instantly share code, notes, and snippets.

@badarshahzad
Created November 2, 2018 17:09
Show Gist options
  • Save badarshahzad/f025bdd4f52f894c0d3a0ea263d42130 to your computer and use it in GitHub Desktop.
Save badarshahzad/f025bdd4f52f894c0d3a0ea263d42130 to your computer and use it in GitHub Desktop.
Android Snippets
//Get the all countries name
public static ArrayList<String> getCountriesName() {
ArrayList<String> list = new ArrayList<String>();
String[] locales = Locale.getISOCountries();
for (String countryCode : locales) {
Locale obj = new Locale("", countryCode);
//Log.i(TAG, "Country Name = " + obj.getDisplayCountry());
list.add(obj.getDisplayCountry());
}
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment