How to delete all files and folders in one folder on Android

前端 未结 12 1030
广开言路
广开言路 2021-01-30 17:52

I use this code to delete all files:

File root = new File(\"root path\");
File[] Files = root.listFiles();
if(Files != null) {
    int j;
    for(j = 0; j < F         


        
12条回答
  •  日久生厌
    2021-01-30 18:15

    you can try this code to delete files and subfiles

    public void deleteFile(File f){
    String[] flist=f.list();
    for(int i=0;i

提交回复
热议问题