Reputation: 69
I get this error from Eclipse:
The constructor File(List<String>) is undefined
at this part of the code
public void deleteFunction(int id){
Toast.makeText(this, "Sters", Toast.LENGTH_SHORT).show();
File file = new File(path);
boolean deleted = file.delete();
}
Upvotes: 1
Views: 72
Reputation: 132982
because path is ArrayList
and you will need to pass path of file from path ArrayList instead of whole ArrayList change your code as:
public void deleteFunction(int id){
//...
if(id<path.size()){
File file = new File(path.get(id));
boolean deleted = file.delete();
}
}
Upvotes: 1
Reputation: 5817
It simply means there's no File
constructor taking a list of strings.
Upvotes: 1