【发布时间】:2019-03-06 07:09:19
【问题描述】:
我尝试编写一个类来管理 SQLite DB,但我收到错误消息“期待顶级声明 > 任务:app:buildInfoGeneratorDebug”。
package com.xexxxwxxxxs.GMP
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.content.Context
import android.content.ContentValues
class DBHandler(context: Context, name: String?, factory: SQLiteDatabase.CursorFactory?, version: Int) : SQLiteOpenHelper(context, DATABASE_NAME, factory, DATABASE_VERSION)
{
override fun onCreate(db: SQLiteDatabase)
{
}
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
{
}
companion object
{
private val DATABASE_VERSION = 1
private val DATABASE_NAME = "GMP.db"
}
}
你有什么想法吗?
提前致谢
【问题讨论】:
标签: android sqlite kotlin companion-object