title: Get real path by Uri for any type of file
body: <p>Here's what I would like to do in my app:</p>
  
  <ul>
  <li>allow user to select files and store paths to them inside a database</li>
  <li>display names of those files</li>
  <li>allow user to click on filename and open the chosen file</li>
  </ul>
  
  <p>So I'd like to get real path to file and store it. The user will only be allowed to get files from internal/external storage so, as I assume, the real path will always exist. I've been looking for solutions and pretty much everyone asks only about images/audio/video and uses MediaStore in their solutions (and I, as of now, have no idea what this is, and I can get Uri without using it). I'd like a solution that would work with any type of file, if that's possible.</p>
  
  <p>Here's how I'm getting Uri: </p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
  intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);
  intent.setType("*/*");
  startActivityForResult(Intent.createChooser(intent, "Choose File"), 1);
  </code></pre>
  
  <p>and I'm storing the received information in <code>onActivityResult</code> method.</p>
  
  <p>So i get Uri and store it as a string which looks like, for example,  <code>content://com.android.providers.downloads.documents/document/4588</code>. How do I convert it to a real filepath?</p>