title: Open local file Android
body: <p>I have a file located on my virtual. and I try to do this: </p>
  
  <pre><code>    File file = new File("invoice2.xml");
      if (file.exists()) {
      textview1.setText("file exists");
      }
      else{
      textview1.setText("file dosen't exist");
      }
  </code></pre>
  
  <p>This displays "file dosen't exist". I am using eclipse and according to the DDMS file explorer my "invoice2.xml" file is located in</p>
  
  <p>data/data/invoicing.digital.namespace/files/invoice2.xml</p>
  
  <p>What am I doing wrong? How can I get the "file exists" result? 
  thank you</p>
  
  <p>EDIT: this worked File file = new File(MyActivity.this.getFilesDir(), "invoice2.xml");</p>