关于" _id"在Android的SQLite的领域 [英] About "_id" field in Android SQLite

查看:163
本文介绍了关于" _id"在Android的SQLite的领域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是场_id必要的,Android的SQLite的?

Is the field "_id" necessary in Android SQLite?

推荐答案

_id当您使用增强型适配器这使得使用游标(如ResourceCursorAdapter)是很有用的。它的使用由这些适配器,以提供可被用来指特定的行中涉及的在任何适配器被用于(例如一排在ListView)的项目表的ID。

_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).

这是,如果你不打算使用它需要一个_id列在游标类没有必要的,而且你还可以使用作为_id做好像它被称为_id在你的光标另一列出现。

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.

这篇关于关于" _id"在Android的SQLite的领域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆