标签:android nomedia 屏蔽图片 android图片 android图库
总结 Android避免文件泄露在系统图库和系统铃声中
在应用开发中 项目的图片总是被系统的图库收录了
避免图片被系统图库收录的发现有2个方法
第一种针对图片
将 .png为后缀的图片全部改名为 .ing 后缀
例如 ic_launcher.png 改为 ic_launcher.ing
第二种
在项目存放图片的文件夹写入
File nomedia = new File(filePath + "/.nomedia" );
if (! nomedia.exists())
try {
nomedia.createNewFile();
} catch (Exception e) {
e.printStackTrace();
}
标签:android nomedia 屏蔽图片 android图片 android图库
原文地址:http://blog.csdn.net/aaawqqq/article/details/40109021