2

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.

Any answer is appreciated.

kablu
  • 629
  • 1
  • 7
  • 26
user3205481
  • 21
  • 1
  • 2
  • 1
    You should at least include what you've tried to do to achieve it. Googling it before asking is a good practice too. – nKn Jan 17 '14 at 07:41

2 Answers2

5

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.

FD_
  • 12,947
  • 4
  • 35
  • 62
2

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

Community
  • 1
  • 1
Manuel Allenspach
  • 12,467
  • 14
  • 54
  • 76