How can we define static variable for a class member in Kotlin Android?

I have reviewed for couple of days after i found that how can we do static variable in android kotlin.

Here is demo code example.

class App : Application() {

    companion object {
        var myModel: MyModel? = null    }

    override fun onCreate() {
        super.onCreate()
    }
}
 
Thanks 

Comments

Popular posts from this blog

How to create Text Watcher in Android kotlin ?

Spin and coin link for coin master