当我第一次从微调器中选择时,一切都很好,第二次选择时一切都很好,但之后从它中选择时,它显示错误
E/AndroidRuntime(10594): java.lang.ArrayIndexOutOfBoundsException: length=20; 指数=20
public static ArrayList<String> s=new ArrayList<String>();
for(........
s.add(e.child(2).text());
}
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
try{
editPrice.setText(""+Splash.s.get(pos));
}catch (Exception e) {
Toast.makeText(parent.getContext(),"The country is "+pos, Toast.LENGTH_LONG).show();
}
}