I have a singleton Class ``` class UserManager pri...
# android
s
I have a singleton Class
Copy code
class UserManager private constructor() {
	private object Holder {
		val INSTANCE = UserManager()
	}

	var currentUser: UserModel? = null
		private set

	companion object {
		val instance: UserManager by lazy { Holder.
and I want to use this in xml for databinding, but the following gives 
android:text="UserManager.Companion.getInstance().getCurrentUser()}

error: Could not find accessor for UserManager.Companion.
s
It looks like the code snippet here is incomplete?
Either way, consider using the
object
identifier for singletons: https://antonioleiva.com/objects-kotlin/
u
@JvmField
or something like that, i dont remember of top of my head