ghasem deh

ghasem deh

  • NA
  • 258
  • 39.8k

How get videos list from custom directory ?

Apr 14 2018 4:52 PM
Hi guy's
please see this tutorials :
 
http://www.androiddevelopersolutions.com/2013/12/android-play-video-from-sd-card.html#comment-form 
 
but i want read videos list from my app directory , an try this : (but don't show any file)
 
  1. path = contextWrapper.getFilesDir().getPath() + "/videos/";  
  2.   
  3. @SuppressWarnings("deprecation")  
  4.     private void init_phone_video_grid() { // MediaStore.Video.Media.DATA + "=?", selectionArgs, MediaStore.Video.Media.DATE_TAKEN + " DESC"  
  5.         System.gc();  
  6.         String[] proj = {MediaStore.Video.Media._ID, MediaStore.Video.Media.DATA, MediaStore.Video.Media.DISPLAY_NAME, MediaStore.Video.Media.DURATION};  
  7.         String[] selectionArgs = new String[]{path};  
  8.         videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, MediaStore.Video.Media.DATA + "=?", selectionArgs, MediaStore.Video.Media.DATE_TAKEN + " DESC");  
  9.         count = videocursor.getCount();  
  10.         videolist = (ListView) findViewById(R.id.PhoneVideoList);  
  11.         videolist.setAdapter(new VideoAdapter(getApplicationContext()));  
  12.         videolist.setOnItemClickListener(videogridlistener);  
  13.     }