After downloaded the zip file I unzip it, and take it file and use it. but now, How can I delete the downloaded zip file?
Asked
Active
Viewed 2,044 times
-1
-
What version of android? Are you writing a program to do this? – David Vogel Aug 15 '14 at 18:53
-
possible duplicate of [How to delete internal storage file in android?](http://stackoverflow.com/questions/3554722/how-to-delete-internal-storage-file-in-android) – Sam Aug 15 '14 at 19:11
-
@KaliforniaDreaming It isn't possible to "un-flag" a post. – Sam Aug 15 '14 at 19:34
-
Welcome to [so]. Questions here should __show research effort or attempts__. Please take a __[tour]__. – Unihedron Aug 22 '14 at 00:56
1 Answers
4
Just use the delete()
method in your File
. Like this:
File file = new File(filePath);
boolean deleted = file.delete();
filePath
is a String
containing the path to your zip file.
Do not forget to check if deleted is true. It is true if the file was successfully deleted.

Infinite Recursion
- 6,511
- 28
- 39
- 51

joao2fast4u
- 6,868
- 5
- 28
- 42