我正在尝试从 SD 卡中获取音频文件。这是我正在使用的代码:
//the URI where I want the query to be performed
Uri externalAudio = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
String projection[] = new String[] {"android.provider.MediaStore.Audio.Media.TITLE"};
Cursor curExternalAudio = cr.query(externalAudio, projection, null, null, null);
//code to display result
错误在最后一行,但它是由投影数组引起的。logcat中显示的错误如下:
E/AndroidRuntime(1994): Caused by: android.database.sqlite.SQLiteException: near ".": syntax error (code 1): , while compiling: SELECT android.provider.MediaStore.Audio.Media.TITLE FROM audio
谁能告诉我这段代码有什么问题??