【发布时间】:2013-03-09 09:53:40
【问题描述】:
我已经为自己构建了一个包含列表的应用程序。到目前为止,我一直使用SimpleAdapter 来填充列表,但我决定改用ArrayAdapter。问题是,我不知道如何以同样的方式填充ArrayAdapter!这是我使用SimpleAdapter的方式:
adapter=new SimpleAdapter(this, listItems, R.layout.custom_row_view, new String[]{"name", "current", "reset"}, new int[] {R.id.text1, R.id.text2, R.id.text3});
我的 listItems 变量实际上是这样设置的:
static final ArrayList<HashMap<String,String>> listItems = new ArrayList<HashMap<String,String>>();
现在,当尝试使用具有相同参数的 ArrayAdapter 构造函数时,它给了我一个错误。怎么可能做到这一点?
【问题讨论】:
标签: android android-listview android-arrayadapter simpleadapter