我从Eclipse得到这个错误:
The constructor File(List<String>) is undefined在代码的这一部分
public void deleteFunction(int id){
Toast.makeText(this, "Sters", Toast.LENGTH_SHORT).show();
File file = new File(path);
boolean deleted = file.delete();
} 发布于 2013-02-06 03:49:38
由于path为ArrayList,您需要从path ArrayList而不是整个ArrayList传递文件的path,因此将代码更改为:
public void deleteFunction(int id){
//...
if(id<path.size()){
File file = new File(path.get(id));
boolean deleted = file.delete();
}
} 发布于 2013-02-06 03:47:22
这仅仅意味着没有接受字符串列表的File构造函数。
https://stackoverflow.com/questions/14715629
复制相似问题