About “_id” field in Android SQLite

_id is useful when you are using the enhanced Adapters which make use of a Cursor (e.g. ResourceCursorAdapter). It’s used by these adapters to provide an ID which can be used to refer to the specific row in the table which relates the the item in whatever the adapter is being used for (e.g. a row in a ListView).

It’s not necessary if you’re not going to be using classes which need an _id column in a cursor, and you can also use “as _id” to make another column appear as though it’s called _id in your cursor.

Leave a Comment