在调用 ArrayAdapter 构造函数时,需要提供三个参数:上下文、布局文件和数据列表。例如:
ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, dataList);
其中,this 表示当前 Activity 的上下文,android.R.layout.simple_list_item_1 是一个 Android SDK 自带的简单布局文件,dataList 是一个 List 类型的数据列表。根据实际需求,可以选择不同的布局文件和数据列表类型。如果在调用构造函数时缺少或使用了错误的参数,就会出现“none of the following can be called with the arguments supplied”的错误提示。