我想在Android中使用动态字段创建ListView。首先,我试图设置它使用如何在Android中正确设置ArrayAdapter
String[] chars = {"TEST"};
setListAdapter(new ArrayAdapter<String>(this,R.layout.resultlist,chars));
它给我错误The constructor ArrayAdapter<String>(ViewTranslationsList.GrabURL, int, int) is undefined
这在下文中示出的静态字段(字符串[]字符)。问题在哪里?
我想在将ArrayAdapter设置为for循环之前,将项目添加到chars
数组中。
感谢