Код: Выделить всё
public class country extends Application {
public ArrayList countryList = new ArrayList();
public String Name;
public String Code;
public String ID;
public country()
{
}
public country(String name, String id, String code)
{
this.Name = name;
this.ID = id;
this.Code = code;
}
public void setCountry(country c)
{
countryList.add(c);
}
public country getCountry(int index)
{
country aCountry = countryList.get(index);
return aCountry;
}
Код: Выделить всё
country ref = new country();
ref.setCountry(new country (sName, ID, Code));
Код: Выделить всё
String name = ref.countryList.get(2).Name;
Подробнее здесь: https://stackoverflow.com/questions/164 ... th-android
Мобильная версия