title: How to delete file from storage
body: <p>I have a content menu where it is pop up a menu of rename and delete when you press the item in few seconds. But i dont know how to get the correct directory of one file. Here is my code:</p>
  
  <pre><code>@Override
  public boolean onContextItemSelected(MenuItem item) {
      AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
      switch(item.getItemId()) {
          case R.id.rename:
              // edit stuff here
              return true;
          case R.id.delete:
  
              File dir = new File(Environment.getExternalStorageDirectory()+"/Music/MusicPlayer");
              if (dir.isDirectory())
              {
                  String[] children = dir.list();
                  for (int i = 0; i &lt; children.length; i++)
                  {
                      new File(dir, children[i]).delete();
                  }
              }
  
              // remove stuff here
              return true;
          default:
              return super.onContextItemSelected(item);
      }
  }
  </code></pre>