kotlin 获取当前类的对象

private val instance by lazy { this }

方式一用lazy方法

this@类名

方式二用this关键字

方式三在onCreate中保存,这里就不举例了

你可能感兴趣的:(kotlin,android)