Programing/android
[android studio] context 종류 및 역활
Benedictus711
2021. 11. 4. 19:31
728x90
View.getContext()
현재 실행되고 있는 View의 Context를 return
보통은 현재 활성화된 Activity의 Context가 됨
Activity.getApplicationContext()
Applcation Lifecycle에 해당하는 Context를 return
ContextWrapper.getBaseContext()
자신의 Context가 아닌 다른 Context에 접근할 때 사용
728x90