소프트웨어에 대한 모든 것

getActivity(), getView() 차이 본문

안드로이드

getActivity(), getView() 차이

앤테바 2020. 12. 14. 10:34
반응형

getActivity()

- Fragment를 호스팅하는 Activity를 리턴

 

getView()

- onCreateView에서 inflated된 view를 리턴

- Get the root view for the fragment's layout

 

Fragment 내에서 findViewById()를 호출하기 위해서는 getView() 통해서 접근할 수 있습니다.

반응형
Comments