zendesk / android-db-commons

Some common utilities for ContentProvider/ContentResolver/Cursor and other db-related android stuff
Apache License 2.0
222 stars 28 forks source link

EmptyCursor should never crash when asked for column index. #6

Closed chalup closed 11 years ago

chalup commented 11 years ago

The smelly thing here is returning -1 from getColumnIndexOrThrow, but it's necessary to make the EmptyCursor work with CursorAdapter, which expects the BaseColumns._ID column to be present in non-null Cursors.