简体   繁体   中英

How to find and delete media files on device in Android

I am creating an app to find and delete media files like video, photo saved on the Android device. I think I should go the way of Intents but I am not sure of the approach.

Could anyone please advise me on how to achieve this?

Thanks.

Try searching for the files with popular media formats like (mpg, avi, 3gp, jpg etc).

Use f.getName().endsWith(".3gp") //for 3gp, where f is the File object.

Delete these files using f.delete().

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM