Summarize Android to avoid file leaks in System gallery and system ringtones
Images of projects in application development are always included in the system's Gallery
There are 2 ways to avoid images that are included in the System gallery
The first one for the picture
Rename the. png suffix image to. ing suffix
For example Ic_launcher.png instead of ic_launcher.ing
The second Kind
The folder where the project holds the picture is written
/.nomedia
File Nomedia = new file (FilePath + "/.nomedia"); if (! nomedia.exists ())) try { nomedia.createnewfile (); } catch (Exception e) { e.printstacktrace (); }
FilePath for the directory you want to hide
Generate the. Nomedia folderThe principle is the SD card, the library will automatically skip the. nomedia file, the scanned image, ringtones and other multimedia files Media_type set to 0remark:media_type value 0: Normal file, 1: Picture file, 2: Audio file, 3: Video file). and the library shows the file is (Media_type = 1 or media_type = 3
My references:http://blog.csdn.net/wqhjfree/article/details/8089591
http://blog.sina.com.cn/s/blog_832a912401014gfw.html
Android avoids the disclosure of images and other resources in the system Gallery