Kotlin, application context 가져오기

sunj - Sep 4 - - Dev Community
android:name=".MyApplication"
Enter fullscreen mode Exit fullscreen mode
class MyApplication : Application() {

    init{
        instance = this
    }

    companion object {
       lateinit var instance: MyApplication
        fun ApplicationContext() : Context {
            return instance.applicationContext
        }
    }

}
Enter fullscreen mode Exit fullscreen mode

참조 : https://ddangeun.tistory.com/78

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player