java - deleting file from sdcard in android application for voice changer -


hi making voice changer application in have delete added pcm file in sdcard. format in song saved is: name.pcm

file f = new file(filepath + "/" + dir.getname() , selectedfileoflistview + ".pcm"); f.delete(); 

where selectedfileoflistview name of selected file.and following list files in directory.

dir = new file(filepath,"recordings");         if(!dir.exists()){             dir.mkdirs();         }         file tempfile = new file(filepath,"hi");         if(tempfile.exists())             tempfile.delete();         file = new file(filepath + "/" + dir.getname() , "test.pcm");          // check list of files in directory         files = dir.list();          if (files == null) {             list.add("no recordings saved yet.");         } else {             list.clear();             (int = 0; < files.length; ++i) {                 list.add(files[i]);             }          } 

so heres code selected file deletion

            file f = new file(path_to_directory + "/" + selected_file);         if (f!=null && f.exists()){ //delete f.delete(); } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -