I have a list of the countries stored into XML, as follows:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="nation_array">
<item>Afghanistan</item>
<item>Albania</item>
<item>Algeria</item>
<item>American Samoa</item>
<item>Andorra</item>
<item>Angola</item>
<item>Anguilla</item>
<item>Antarctica</item>
................
</string-array>
</resources>
Adapter:
String[] countries = groupContent.getResources().getStringArray(R.array.nation_array);
ArrayAdapter<String> nationAdapter = new ArrayAdapter<>(mContext, R.layout.simple_list_item_1, countries);
autoCompleteTextView.setAdapter(nationAdapter);
And everything works fine. But now it turned out that need to drop-down list to show the name of the country, but when sending a double-digit use the abbreviations of countries, such as United States - US.
<?xml version="1.0" encoding="UTF-8"?>
<country-list>
<country>
<name>Абхазия</name>
<english>Abkhazia</english>
<code>AB</code>
</country>
<country>
<name>Австралия</name>
<english>Australia</english>
<code>AU</code>
</country>
<country>
<name>Австрия</name>
<english>Austria</english>
<code>AT</code>
</country>
<country>
<name>Азербайджан</name>
<english>Azerbaijan</english>
<code>AZ</code>
</country>
.............
</country-list>
Q: How does it realize, tell me? Nowhere are such examples found
