Cursor getColumnIndexOrThrow - Get the Index for a Column Name

Cursor getColumnIndexOrThrow was added in API Level 1

public abstract int getColumnIndexOrThrow (String columnName)
Returns the zero-based index for the given column name, or throws IllegalArgumentException if the column doesn't exist. If you're not sure if a column will exist or not use getColumnIndex(String) and check for -1, which is more efficient than catching the exceptions.
Parameters: columnName the name of the target column.
Returns: the zero-based column index for the given column name
Throws: IllegalArgumentException if the column does not exist

1. Move the Cursor to the First Row of a Cursor named myCursor.

2. Add the below code right after if (myCursor.moveToFirst()) { where the // myCursor moved to the first record comment is located. This will save the contents of the Display name of an audio file to a string named myString

try {    String myString = cursor.getString(cursor.getColumnIndexOrThrow(android.provider.MediaStore.Audio.Media.DISPLAY_NAME));
} catch (IllegalArgumentException e ) { 
e.printStackTrace();
}

3. Compile and run!

4. Other column names for MediaStore Audio files are listed here

Resources:
http://developer.android.com/reference/android/database/Cursor.html#getColumnIndexOrThrow(java.lang.String)