title: I am trying to write a method to delete a file from the internal storage in Android device and
body: <pre><code>imagedirectory = new File(path);
  imagepool = imagedirectory.listFiles();
  Uri targetdelete = Uri.fromFile(imagepool[photoindex]); //photoindex is integer 1
  File filetodelete = new File(targetdelete);
  boolean deleted = filetodelete.delete();
  </code></pre>
  
  <p>I am receiving an error in this line </p>
  
  <pre><code>File filetodelete = new File(targetdelete);
  </code></pre>
  
  <p>it says targetdelete must be a string object....  I thought it was valid to put Uri object as the agrument when initializing a File object?</p>
  
  <p>Thanks once again, wonderful experts on stack overflow!!  </p>