You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
override fun onCreate(SavedInstanceState: Bundle?){
......
val repository = NewsRepository(ArticleDatabase(this)
# In this line following error occured.
/*
Error
Type mismatch.
Required: ArticleDatabase
Found:Unit
*/
}
I changed 'invoke' function in ArticleDatabase.kt as follows and it seems works without snag(I don't know it is right way or not though....)
operator fun invoke (context:Context) : ArticleDatabase {
return instance ?: synchronized(LOCK){
instance ?: createDatabase(context).also{ instance = it }
}
Thank you for your awesome videos and great instruction!!
The text was updated successfully, but these errors were encountered:
Where I get an error
Architectural Skeleton - MVVM News App Around 4:00
NewsActivity.kt. (onCreate function.)
I changed 'invoke' function in ArticleDatabase.kt as follows and it seems works without snag(I don't know it is right way or not though....)
Thank you for your awesome videos and great instruction!!
The text was updated successfully, but these errors were encountered: