I hope this is updated with the sqlite support library of androidx
brownsoo opened this issue · comments
brownsoo commented
3.2 version works OK. but I hope this is updated with the sqlite support library of androidx.
Jake Wharton commented
Is jetifier not sufficient?
…On Thu, Nov 8, 2018, 7:24 PM brownsoo ***@***.*** wrote:
3.2 version works OK. but I hope this is updated with the sqlite support
library of androidx.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#252>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEYF9liMadv5x21SnOlmtQIMB2aaQks5utMs9gaJpZM4YVvKI>
.
brownsoo commented
Yes. Jetifier is sufficient. I mentioned this because just hinting the type mismatch error in IDE. It's not required issue.
import androidx.sqlite.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteOpenHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
...
private var brite: BriteDatabase? = null
fun open() {
// Type mismatch hinting in android studio IDE ----- //
brite = sqlBrite().wrapDatabaseHelper(openHelper(context), Schedulers.io())
}
private fun openHelper(context: Context): SupportSQLiteOpenHelper {
val configuration = SupportSQLiteOpenHelper.Configuration.builder(context)
.name(DB_NAME)
.callback(DBCallback(DB_VERSION))
.build()
return FrameworkSQLiteOpenHelperFactory().create(configuration)
}
Jake Wharton commented
Did you invalidate caches and restart? Running jetifier is pretty damaging in terms of the IDE's cache and resetting it tends to fix these issues.
brownsoo commented
Gooood!! Thank ~~! You are the best!!