Cursor android.content.ContentResolver.query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
这个selectionArgs只能写一个么??

解决方案 »

  1.   

    ArrayList<String> category = MusicMainActivity.audioId;
    String[] projection = new String[] { "distinct "
    + MediaStore.Audio.Media.ARTIST ,MediaStore.Audio.Media._ID};
    String audio_ids = category.toString().replace('[', ' ').replace(']', ' ');
    String[] selectionArgs = new String[]{audio_ids};
    ContentResolver resolver = mContext.getContentResolver();
      Cursor c = resolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
    projection, " _id = ?", selectionArgs,
    MediaStore.Audio.Media.DEFAULT_SORT_ORDER);selectionArgs = 174, 175, 176, 177, 178, 179, 180这样一条都查询不出来。