在Android中使用BaseColumns是什么 [英] What is the use of BaseColumns in Android
本文介绍了在Android中使用BaseColumns是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Android中从 BaseColumns
中实现类的使用是什么?
What is the use of implementing a class from BaseColumns
in Android?
推荐答案
这是一个简单的界面,它添加了两个字段:
This is a simple interface which adds two fields :
public interface BaseColumns
{
/**
* The unique ID for a row.
* <P>Type: INTEGER (long)</P>
*/
public static final String _ID = "_id";
/**
* The count of rows in a directory.
* <P>Type: INTEGER</P>
*/
public static final String _COUNT = "_count";
}
在Android中使用的内部sqlite数据库带有 _id
列,它可以自动递增,并且可以充当主键。这也可以很好地映射到 ContentProviders
Internally sqlite databases used in Android, comes with an _id
column that autoincrements and can function as a primary key. This also maps well with the ContentProviders
这篇关于在Android中使用BaseColumns是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文