file - how to hide a Folder in android programatically -


i trying develop android application hiding folders.

i used file.renameto(new file("." + file.getname())); in log i'm getting folder name prefix dot(.), still folder not hidden.

on clicking folder in recycler view trying hide folder clicked.

also if folder hidden trying un hide it.

foldersholder.folderrow.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {                 file file = new file(foldernames.get(position));                 if(!file.ishidden()) {                     file.renameto(new file("." + file.getname()));                     toast.maketext(context, file.getname() + " hidden", toast.length_short).show();                 }                 else {                     file.renameto(new file(file.getname().substring(1)));                     toast.maketext(context, file.getname() + " shown", toast.length_short).show();                 }              }         }); 

please help!

create folder . (dot) before name, , add empty .nomedia file inside it. (.(dot)nomedia - typed it) , add files ands images there.

now other apps gallery ignore these images. that's way think can done.

e.g.: folder name: .images

which includes empty file .nomedia


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -