BaseColumns类的作用
生活随笔
收集整理的這篇文章主要介紹了
BaseColumns类的作用
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
這個(gè)類(lèi)只是提供了兩個(gè)字段,一個(gè)是"_id"一個(gè)是"_count",便于調(diào)用數(shù)據(jù)庫(kù)時(shí)導(dǎo)致拼寫(xiě)錯(cuò)誤,你也可以擴(kuò)展它,或者自定義這么個(gè),然后直接調(diào)用它的常量名,防止寫(xiě)sql語(yǔ)句時(shí)把列名拼錯(cuò)
/** Copyright (C) 2006 The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/package android.provider;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"; }總結(jié)
以上是生活随笔為你收集整理的BaseColumns类的作用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 云马龙
- 下一篇: xftp地址栏消失解决办法