「アイコン」と「名前」の2列のリストを入力する単純なAndroidスピナーがあります。これは完璧に機能します。
ArrayList<HashMap<String, Object>> stationList = new ArrayList<HashMap<String, Object>>();
... // fill stationList
Spinner spinner = (Spinner) findViewById(R.id.stations);
SimpleAdapter adapter = new SimpleAdapter(
this,
stationList,
R.layout.listitem,
new String[] { "icon", "name" },
new int[] {R.id.option_icon, R.id.option_text });
spinner.setAdapter(adapter);
「名前」を知っているだけで、リストから行を取得するにはどうすればよいですか?スピナーのIDも位置もわかりません!
ありがとう!