//.nomedia file is to tell the OS to not display images/other media from our sdcard directory //in the Gallery and other apps. File noMediaFile = new File(Application.ROOT_DIR + ".nomedia"); //SDCard程序根目录下 if (!noMediaFile.exists()) { try { noMediaFile.createNewFile(); } catch (IOException e) { Log.e("Application startup", "Cannot create .nomedia file", e); } }