Java tutorial
//package com.java2s; import java.io.File; public class Main { public static void makeNoMediaFile(File dir) { try { File f = new File(dir, ".nomedia"); if (!f.exists()) { f.createNewFile(); } } catch (Exception e) { } } }