Even though this question is from 2011, the topic is still relevant and there's no proper answer here.
So this code below should work on today's Android devices:
String selection = "_data LIKE '%.pdf'"
try (Cursor cursor = getApplicationContext().getContentResolver().query(MediaStore.Files.getContentUri("external"), null, selection, null, "_id DESC")) {
if (cursor== null || cursor.getCount() <= 0 || !cursor.moveToFirst()) {
// this means error, or simply no results found
return;
}
do {
// your logic goes here
} while (cursor.moveToNext());
}