我正像这样从我的 android 应用程序中删除一个文件
public static Boolean deleteObject(Context context, String key) throws IOException,
ClassNotFoundException {
return context.deleteFile(key);
}
但我想删除一个文件,其 key 以提供的 key 开头。
例如:调用这个函数
deleteObject(this,"file")
删除名称为“file-10-10-14”的文件
最佳答案
你可以用
获取文件列表context.fileList();
然后从字符串数组中获取要删除的文件的文件名,用key删除。
关于android - 通过其键模式从android中删除上下文文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27078525/