title: Android Video Listing from local device?
body: <p>I use the Managed Query to fetch the list of information regarding video stored in local device.</p>
  
  <p>The code i used for that is shown below,</p>
  
  <pre><code>System.gc();
  String[] proj = { MediaStore.Video.Media._ID,
  MediaStore.Video.Media.DATA,
  MediaStore.Video.Media.DISPLAY_NAME,
  MediaStore.Video.Media.SIZE,
  MediaStore.Video.Media.DATE_ADDED,
  MediaStore.Video.Media.DURATION
  };
  
  
  
  videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
  proj, null, null, null);
  </code></pre>
  
  <p>It will show only the Video stored under path /sdcard/DCIM/camera, insted of that i need to list the video from specific folder,for that i use the following code</p>
  
  <pre><code>Uri test=Uri.parse("/sdcard/video");
  
  videocursor = managedQuery(test,proj, null, null, null);
  </code></pre>
  
  <p>but it will show an error.Any provide the solution to parse and fetch the video from particular folder to list the video.</p>
  
  <pre><code>03-07 20:28:16.226: ERROR/AndroidRuntime(4969): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cpt.ViddyGo/com.cpt.ViddyGo.LocalVideolist}: java.lang.NullPointerException
  03-07 20:28:16.226: ERROR/AndroidRuntime(4969): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2542)
  03-07 20:28:16.226: ERROR/AndroidRuntime(4969): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2381) 
  </code></pre>