The
delete
function of the
File
class
returns a
Boolean
value to indicate whether
the delete
operation was successful; this function returns that value to where it was
called in
MainActivity
.
Build and run the app. Delete
a file by tapping the
DELETE
button; you’ll see the
appropriate message.
To
confirm the file was deleted, use the Device File Explorer or try to delete the file a
second time. If
everything worked as expected, you’ll see a message that indicates
the file could not be deleted (because it’s already gone).
Internal storage is great for storing private data in an app. But what if you want to
store data temporarily? To do this, you can use
Do'stlaringiz bilan baham: