Hi im using merge cursor to show the data result in my list view, i added an indexer and all its working fine but i noticed the a-z its ok show me the External Data, after that again a-z but now internal data, so my index "works" but not as i wish, i know mergecursor cant be sorted so im wondering can i do a rawquery? to join MediaStore.Audio.Media.INTERNAL_CONTENT_URI and MediaStore.Audio.Media.EXTERNAL_CONTENT_UR ?? and how? i want to join and then sort by Song ASC. or MediaStore.Audio.Media.DEFAULT_SORT_ORDER or how i can convert an array list or other collection to cursor?
现行法典:
private Cursor getInternalAudioCursor(String selection,
String[] selectionArgs) {
return this.getContentResolver().query(
MediaStore.Audio.Media.INTERNAL_CONTENT_URI,
INTERNAL_COLUMNS,
selection,
selectionArgs,
MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
iii
private Cursor getExternalAudioCursor(String selection,
String[] selectionArgs) {
return this.getContentResolver().query(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
EXTERNAL_COLUMNS,
selection,
selectionArgs,
MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
iii
Cursor c = new MergeCursor(new Cursor[] {
getExternalAudioCursor(selection, argsArray),
getInternalAudioCursor(selection, argsArray)iii);
startManagingCursor(c);