0
点赞
收藏
分享

微信扫一扫

使用SimpleAdapter绑定的spinner

List<Map<String, String>> list = new ArrayList<>();
for (int i = 0; i < 10; i++) {
Map<String, String> map = new HashMap<>();
map.put("item", response.getData().get(i));
list.add(map);
}
SimpleAdapter adapter = new SimpleAdapter(DocumentApplayActy.this, list, android.R.layout.simple_spinner_dropdown_item,
new String[]{"item"}, new int[]{android.R.id.text1});
mSpPurposes.setAdapter(adapter);
// mSpPurposes.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
// @Override
// public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// }
//
// @Override
// public void onNothingSelected(AdapterView<?> parent) {
//
// }
// });


举报

相关推荐

0 条评论