๋ฐ์ํ
https://juahnpop.tistory.com/231
์ฐธ์กฐํ๊ณ ์ ํ๋ class ๋ด์์ ๋ค์๊ณผ ๊ฐ์ด ์ ์ธ
init{
instance = this
}
companion object{
private var instance:MyActivity? = null
fun getInstance(): MyActivity? {
return instance
}
}
์ดํ ์ธ๋ถ ํด๋์ค๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ ํด๋์ค์์ ๋ค์๊ณผ ๊ฐ์ด ์ ์ธ ํ ๋ด๋ถ ๋ฉ์๋ ์ฌ์ฉ๊ฐ๋ฅ
private val myActivity = MyActivity.getInstance()
728x90
๋ฐ์ํ
'์ฑ ๐ป > ์๋๋ก์ด๋์คํ๋์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์๋๋ก์ด๋์คํ๋์ค] Unresolved reference: kotlinx ์๋ฌ (1) | 2021.04.28 |
---|