Reputation: 327
I have an application that download picture from internet.I want when download picture don't show in gallery but show in SD card and folder because the user can delete the file. Like of telegram. When i add . first of name of file hide from everywhere
Upvotes: 0
Views: 213
Reputation: 991
Here is the code:
private void createNoMedia() {
final File nomedia = new File(getConversationsFileDirectory()+".nomedia");
if (!nomedia.exists()) {
try {
nomedia.createNewFile();
} catch (Exception e) {
Log.d(Config.LOGTAG, "could not create nomedia file");
}
}
}
public static String getConversationsFileDirectory() {
return Environment.getExternalStorageDirectory().getAbsolutePath()+"/YourFolder/";
}
Upvotes: 1
Reputation: 1472
Try this.
Upvotes: 0