title: File not exists (Android)
body: <p>I have a code in which user selects a file and program returns <code>android.net.Uri</code> for the selected file. Next, the program converts <code>Uri</code> to <code>java.io.File</code>. When i invoke <code>File.exists()</code> the program returns <code>false</code>. Why the program cannot interract with existing file?</p>
  
  <p>(for example, i select <code>1.pdf</code> on my microsd card, but the result will be the same if i select any other file from internal storage)</p>
  
  <pre><code>public void onClick(View v) {
      Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
      intent.addCategory(Intent.CATEGORY_OPENABLE);
      intent.setType("application/pdf");
  
      startActivityForResult(intent, 123);
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode,
                               Intent resultData) {
      super.onActivityResult(requestCode, resultCode, resultData);
      if (requestCode == 123
              &amp;&amp; resultCode == Activity.RESULT_OK) {
  
          if (resultData != null) {
              Uri uri = resultData.getData();
              try {
                  File f=new File(uri.getPath());
  
                  Log.e(TAG,"File object "+f.getAbsolutePath()); //returns /document/9016-4EF8:1.pdf
                  Log.e(TAG,"File exists "+f.exists()); //returns false
  
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>