大佬教程收集整理的这篇文章主要介绍了android-studio-2020.3.1.14 中不存在新 android studio 中的 @Violate,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
大家好,今天我尝试使用房间数据库,但我不能,因为@Violate 注释,而不是源。 即使我无法使用 databaseBuilder 构建自己的数据库,我也得到了未解决的参考:java 错误 对于 PersonDatabase::class.java
@H_419_2@@Database(entitIEs = [person::class],version = 1,exportscheR_858_11845@a = falsE)
abstract class PersonDatabase:roomDatabase() {
abstract fun personDao():PersonDao
companion object {
private var INSTANCE: PersonDatabase? = null
fun getDatabase(context: Context): PersonDatabase {
// if the INSTANCE is not null,then return it,// if it is,then create the database
return INSTANCE ?: synchronized(this) {
val instance = Room.databaseBuilder(
context.applicationContext,PersonDatabase::class.java,"word_database"
).build()
INSTANCE = instance
// return instance
instance
}
}
}
以上是大佬教程为你收集整理的android-studio-2020.3.1.14 中不存在新 android studio 中的 @Violate全部内容,希望文章能够帮你解决android-studio-2020.3.1.14 中不存在新 android studio 中的 @Violate所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。