Tarun
04/10/2018, 9:17 AMcompanion object
, than those variable are treated as static in Java
But when I try to access those variable in a java project, which is using library, It is like :
MyClass.Companion.abcVariable
I searched and found I had to append @JvmStatic in front of variable so that java can access it directly like :
MyClass.abcVariable
This works for classes
but for interfaces
it requires a min API level of 24 and my Min API level is 21
Is there any other way to directly access companion object variables for interface
in API projects supporting min API level less than 24 like :
MyClass.abcVariable
Czar
04/10/2018, 9:27 AMTarun
04/10/2018, 9:29 AM