private void processRestoredCountry() { if (!TextUtils.isEmpty(restoredCountry)) { Country country = countries.getCountryByIso(restoredCountry); restoredCountry = null; if (country != null) { setCountry(country); } } }
private void setupDefaultCountry() { String[] possibleRegions = Phones.getPossibleRegions(getContext()); for (String region : possibleRegions) { Country country = countries.getCountryByIso(region); if (country != null) { this.defaultCountry = country; break; } } }
private void onCountriesLoaded() { if (defaultCountry == null) { setupDefaultCountry(); } processRestoredCountry(); if (this.country != null) { return; } Country country = countries.getCountryByIso(countryFromAttrs); if (country != null) { setCountry(country); } if (this.country == null) { setCountry(defaultCountry); } }
public void setCountryIso(String countryIso) { setCountry(countries.getCountryByIso(countryIso)); }