title: How to get video File Path from uri
body: <p>I am trying to get file path from my video uri.</p>
  
  <p>I have gone through with following links but still facing this issue:</p>
  
  <p><a href="https://stackoverflow.com/questions/3401579/get-filename-and-path-from-uri-from-mediastore">get-filename-and-path-from-uri-from-mediastore</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21186016/get-file-path-from-uri-from-video-chooser">get-file-path-from-uri-from-video-chooser</a></p>
  
  <p>Following is my code:</p>
  
  <pre><code>        Uri imageUri = data.getData();
          String[] proj = { MediaStore.Audio.Media.DATA };
          Cursor cursor = PreferenceHelper.getContext().getContentResolver().query(imageUri, proj, null, null, null);
          int column_index = cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);
          cursor.moveToFirst();
          String filePath = cursor.getString(column_index);
          sendVideo(activity, filePath, windowId, isChatroom);
  </code></pre>
  
  <p><strong><em>content://com.android.providers.media.documents/document/video%3A1142</em></strong></p>
  
  <p>But always get file path null.</p>
  
  <p>Following is my logs:</p>
  
  <pre><code>10-22 13:09:44.189 21604-21604/com.testapp.chat W/System.err: java.lang.NullPointerException
  10-22 13:09:44.190 21604-21604/com.testapp.chat W/System.err:     at java.io.File.fixSlashes(File.java:185)
  10-22 13:09:44.191 21604-21604/com.testapp.chat W/System.err:     at java.io.File.&lt;init&gt;(File.java:134)
  10-22 13:09:44.191 21604-21604/com.testapp.chat W/System.err:     at com.inscripts.plugins.VideoSharing.sendVideo(VideoSharing.java:125)
  10-22 13:09:44.191 21604-21604/com.testapp.chat W/System.err:     at com.inscripts.plugins.VideoSharing.sendVideo(VideoSharing.java:219)
  10-22 13:09:44.192 21604-21604/com.testapp.chat W/System.err:     at com.inscripts.plugins.VideoSharing.sendVideoOneOnOne(VideoSharing.java:104)
  10-22 13:09:44.193 21604-21604/com.testapp.chat W/System.err:     at com.inscripts.activities.SingleChatActivity.onButtonClick(SingleChatActivity.java:617)
  10-22 13:09:44.193 21604-21604/com.testapp.chat W/System.err:     at com.inscripts.custom.CustomAlertDialogHelper.onClick(CustomAlertDialogHelper.java:65)
  10-22 13:09:44.193 21604-21604/com.testapp.chat W/System.err:     at android.view.View.performClick(View.java:4456)
  10-22 13:09:44.194 21604-21604/com.testapp.chat W/System.err:     at android.view.View$PerformClick.run(View.java:18465)
  </code></pre>