Limit number of rows in Cursor query
问题 I need to get contacts from an android phone. so I am using this code: Cursor phones = getActivity().getContentResolver().query(Phone.CONTENT_URI, new String[] { Phone.NUMBER, Phone.TYPE }, " DISPLAY_NAME = ?", new String[] { displayName }, null); while (phones.moveToNext()) { //do work here } I want to tell the cursor to limit the response to 50 with something like "LIMIT 50". Where do I pass that information to the cursor? Please copy and paste my code and make edit there. 回答1: There is no