什么是使用Android中BaseColumns的 [英] What is the use of BaseColumns in Android

查看:245
本文介绍了什么是使用Android中BaseColumns的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,有什么用Android中实现从BaseColumns的一类。

I want to know that , 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 列自动递增,并且可以作为主键的功能。这也映射以及与的ContentProvider 取值

Internally sqlite databases used in Android they come with a _id column that autoincrements and can function as a primary key. This also maps well with ContentProviders

这篇关于什么是使用Android中BaseColumns的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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