목록Android Kotlin (12)
Foggy day

In Kotlin, there are two types immutable and mutable. The first is the immutable list. If you use +(plus) operator, plus value would be added to the list. The important thing is the fact that +(plus) operator create a new list. class KotlinPlayGroundActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.act..
Kotlin
2021. 3. 16. 22:01
Kotlin - Singleton
If you want to create Singleton in Kotlin, just add object instead of class. Singleton can have only one instance. object(singleton) don't have constructor. object MyWindowAdapter : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } }
Kotlin
2021. 3. 16. 21:38