如何以编程方式隐藏的SD卡文件夹中的android [英] How to hide folder in sdcard programmatically in android
本文介绍了如何以编程方式隐藏的SD卡文件夹中的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有它安装在SD卡后,提取xyz.zip文件夹的应用程序。文件夹包含了许多文件(例如视频,音频等)。在安装应用程序,我想隐藏文件夹,隐藏文件夹的所有项目。
先谢谢了。
I have an app with xyz.zip folder which is extracting after installation in sdcard. Folder contains a lot of files(e.g Video,audio,etc.).During installing app I wanna hide that folder and hide all items of folder. Thanks in advance.
任何答案是AP preciated。
Any answer is appreciated.
推荐答案
使用这样的函数:
public static void hideFile(File file){
File dstFile = new File(file.getParent(), "." + file.getName());
file.renameTo(dstFile);
}
请注意我没有尝试在code,但它至少应该给你如何做到这一点的想法。
Please note I did not try the code, but it should at least give you the idea of how to do it.
这篇关于如何以编程方式隐藏的SD卡文件夹中的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文