android / android-ktx

A set of Kotlin extensions for Android app development.
https://android.github.io/android-ktx/core-ktx/
7.48k stars 565 forks source link

Can't use getString(String) : String #591

Closed alfianyusufabdullah closed 6 years ago

alfianyusufabdullah commented 6 years ago

Hi

I'm trying use ext from Cursor like this

val _id = cursor.getString("_id")

but getting error like this

using 'getString(String) : String' is an error, Use an abstraction like room or look up

how to handle it ?

JakeWharton commented 6 years ago

These extensions are being removed. They remain in the code for binary compatibility but will be removed for 1.0 stable. The error message tells you to use a library like SQL Delight or Room, or to prefer doing the column name to index mapping once and caching it rather than something like this extension which has do to that lookup (and its multiple JNI calls) each time.

PaulWoitaschek commented 5 years ago

Hm I don't like this change. I use this a lot in room migrations.