Media files are automatically registered by the system, so you need to use the query to extract the media.
final Cursor cursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
new String[] { MediaStore.Audio.Media.DISPLAY_NAME }, null, null, null);
Loads a cursor. To display it in a ListView, you will need to use a SimpleCursorAdapter to display data in a ListView.
source
share