1、问题
遍历某个目录下的所有问题文件
2、代码实现
fun getRecoverTrashFile(path: String) {if (TextUtils.isEmpty(path))returntry {var file = File(path)if (file == null || !file.exists()) {return}var files = file.listFiles()if (files == null || files.size <= 0) {return}for (i in files.indices) {if (files[i].isDirectory) {var path = files[i].absolutePathgetRecoverTrashFile(path)} else {var file = files[i]addTrashFileByPath(file)}}} catch (e: Exception) {LogUtil.i(TAG, "has error")e.printStackTrace()}}