Complex array in AutoCompleteTextView

ساخت وبلاگ

Vote count: 0

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

asked 51 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : complex array in php,complex array in c,complex array in javascript,complex array in java,complex array in fortran,complex array in python,complex array in matlab,complex array in excel,complex array in idl,complex array in numpy, نویسنده : استخدام کار backsoft بازدید : 294 تاريخ : شنبه 30 مرداد 1395 ساعت: 17:20