Android request ContactsContract in Kotlin
1 answer
This is an open bug in Kotlin. Please refer to: https://youtrack.jetbrains.com/issue/KT-3180 .
Now you can use Java to access fields like this workaround:
public class ContactsSupport {
public static interface BaseColumns {
public static final String _ID = ContactsContract.RawContacts._ID;
public static final String _COUNT = ContactsContract.RawContacts._COUNT;
}
}
So you can write ContactsSupport.BaseColumns._ID
in Kotlin.
+4
source to share