How to hide folder in sdcard programmatically in android

这一生的挚爱 提交于 2019-12-01 11:10:50

Use a function like this:

public static void hideFile(File file){
    File dstFile = new File(file.getParent(), "." + file.getName());
    file.renameTo(dstFile);
}

Please note I did not try the code, but it should at least give you the idea of how to do it.

CommonGuy

If you want to hide folder in Android or any Linux based system just add . as prefix to folder or file name.

Answer stolen from here: How to hide a folder in sdcard in android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!