我有一个自定义对象列表,它是从下载的 JSON 数组创建的,我想Spinner
用列表中的一个字段填充它,但我仍然想保留整个onItemSelected
. 目前我正在这样做
ArrayAdapter<Country> myAdapter = new ArrayAdapter<Country>(Prototype_activity.this, android.R.layout.simple_spinner_item, ValueHolder.countryList)
spinner.setAdapter(myAdapter);
spinner.setVisibility(View.VISIBLE);
那么我如何让适配器只使用每个项目中的一个字段呢?