To limit the number of results in your cursor try:
cursor = cr.query(ContactsContract.Contacts.CONTENT_URI,null, null, null, ContactName + " LIMIT 100");
while(cursor.moveToNext()) {
// something clever
}
Related Contents:
- How can I avoid concurrency problems when using SQLite on Android?
- Best way to work with dates in Android SQLite [closed]
- Pros and Cons of SQLite and Shared Preferences [closed]
- How do I view the SQLite database on an Android device? [duplicate]
- How to call Android contacts list?
- Android: upgrading DB version and adding new table
- Retrieve database or any other file from the Internal Storage using run-as
- How to read contacts on Android 2.0
- How does one check if a table exists in an Android SQLite database?
- How to store JSON object in SQLite database
- Android SQLite database: slow insertion
- Where does Android store SQLite’s database version?
- How to add new Column to Android SQLite Database?
- Android backup/restore: how to backup an internal database?
- Android database encryption
- Send text to specific contact programmatically (whatsapp)
- Query if Android database exists!
- Read all contacts’ phone numbers in android
- What is difference between SQLite and SQL
- IllegalArgumentException: the bind value at index 1 is null
- Best place to close database connection
- Drawable to byte[]
- Cursor adapter and sqlite example [closed]
- Share SQLite database between 2 android apps?
- Android SQLite Example [closed]
- How do I update an android sqlite database column value to null using ContentValues?
- Android contacts Display Name and Phone Number(s) in single database query?
- SQLiteOpenHelper onUpgrade() Confusion Android
- How to delete object from Realm Database Android?
- When to close db connection on android? Every time after your operation finished or after your app exit
- Multiple tables with same type of objects in Room database
- Android Spinner: Get the selected item change event
- Android webview & localStorage
- Which Architecture patterns are used on Android? [closed]
- Android: ScrollView vs NestedScrollView
- Android Paint: .measureText() vs .getTextBounds()
- Best way to add Activity to an Android project in Eclipse?
- Sign APK without putting keystore info in build.gradle
- What exactly does the post method do?
- Android Studio could not find any version that matches com.android.support:appcompat-v7:+
- support FragmentPagerAdapter holds reference to old fragments
- Android Studio – debug keystore
- Android – Activity vs FragmentActivity? [duplicate]
- Android Studio: Background task running indefinitely
- Android accelerometer not working when screen is turned off
- How SurfaceHolder callbacks are related to Activity lifecycle?
- Android popup window dismissal
- DialogFragment and force to show keyboard
- What’s the difference between lineSpacingExtra and lineSpacingMultiplier?
- How to use Kotlin with Proguard