0
私はこの機能をdeveloper.androidから持っていますが、すべての曲を見つけることはできません。私に手がかりを与えてください。私はすべてのトラックを取得するには、以下の使用MediaStore - 機能がすべての曲を見つけることができません
public void getAllSongs() {
ContentResolver contentResolver = getContentResolver();
Uri uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
Cursor cursor = contentResolver.query(uri, null, null, null, null);
if (cursor == null) {
// query failed, handle error.
} else if (!cursor.moveToFirst()) {
// no media on the device
} else {
int titleColumn = cursor.getColumnIndex(android.provider.MediaStore.Audio.Media.TITLE);
int idColumn = cursor.getColumnIndex(android.provider.MediaStore.Audio.Media._ID);
do {
long thisId = cursor.getLong(idColumn);
String thisTitle = cursor.getString(titleColumn);
songs.add(thisId + "||"+thisTitle);// ...process entry...
} while (cursor.moveToNext());
}
}
は私の古い質問を見てみましょう、あなたを助けるかもしれませんhttp://stackoverflow.com/questions/32703442/populate- listview-with-mp3-files-found-locally – Phil3992
曲を見つけてもらいたいが、それは私が望むよりも遅い。しかし、お返事ありがとうございます – ufo13131
あなたはあなたの質問に列を要求していません。以下を参照してください – Theo