title: Unable to read picked file android
body: <p>I am using intent to let user select a video file for processing using the code below</p>
  
  <pre><code>  Intent mediaIntent = new Intent(Intent.ACTION_PICK,MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
    mediaIntent.setType("video/*"); //set mime type as per requirement
    mediaIntent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
    startActivityForResult(mediaIntent,4);
  </code></pre>
  
  <p>And I get the result from the intent as</p>
  
  <pre><code>public String getRealPathFromURI(Uri contentUri) {
      String[] proj = { MediaStore.Images.Media.DATA };
      Cursor cursor = managedQuery(contentUri, proj, null, null, null);
      int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
      cursor.moveToFirst();
      return cursor.getString(column_index);
  }
  public void copy(File src, File dst) throws IOException {
      InputStream in = new FileInputStream(src);
      OutputStream out = new FileOutputStream(dst);
      byte[] buf = new byte[1024];
      int len;
      while ((len = in.read(buf)) &gt; 0) {
          out.write(buf, 0, len);
      }
      in.close();
      out.close();
  }
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      // TODO Auto-generated method stub
      super.onActivityResult(requestCode, resultCode, data);
      try {
          if (requestCode == 4 &amp;&amp; resultCode == Activity.RESULT_OK) {
              String filePath = "";
              Uri _uri = data.getData();
              filePath=getRealPathFromURI(_uri);
              File org = new File(filePath);
              File news=new File(saveFile());
              copy (org,news);
          }
      } catch (Exception ex) {
          Log.e("RESULT","ERROR",ex);
      }
  }
  </code></pre>
  
  <p>I am unable to read/copy the user selected file in the above code. What could be the issue? Also I checked the path returned by Intent from other file manager application and couldn't find the file in path.</p>