안드로이드 개발 질문/답변
(글 수 45,052)
Fragment를 이번에 접해봐서 사용해보고있는데요..
position을 받으려니까 자꾸 바뀌는거같습니다...
탭부분의
public static int position;
public void onPageSelected(int arg0) {
position = arg0;
}
이런형식으로 받은다음
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
에서
switch(position){
case 0:
.
.
.
break;
이런식으로 받으려고 하는데 자꾸 값이 바뀌는건지 제대로 호출이 안되는군요 ㅠㅠ
정확한 position값을 받는 방법이 있을까요?
답변 꼭좀 부탁드릴게요!