Replacement for “GROUP BY” in ContentResolver query in Android Q ( Android 10, API 29 changes)
问题 I'm upgrading some legacy to target Android Q, and of course this code stop working: String[] PROJECTION_BUCKET = {MediaStore.Images.ImageColumns.BUCKET_ID, MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME, MediaStore.Images.ImageColumns.DATE_TAKEN, MediaStore.Images.ImageColumns.DATA, "COUNT(" + MediaStore.Images.ImageColumns._ID + ") AS COUNT", MediaStore.Files.FileColumns.MEDIA_TYPE, MediaStore.MediaColumns._ID}; String BUCKET_GROUP_BY = " 1) and " + BUCKET_WHERE.toString() + " GROUP BY