프레그먼트 생성.
안드로이드 프래그먼트
https://developer.android.com/guide/components/fragments.html?hl=ko
프래그먼트 생성.
public static class ExampleFragment extends Fragment {
//맴버변수 선언.
// 시스템은 프래그먼트를 생성할 때 이것을 호출합니다. 구현하는 구성 요소 중
// 프래그먼트가 일시정지 되거나 중단되었다가 재개되엇을때 유지하고자 하는것을
// 초기화해야 합니다.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
// 레이아웃을 그릴때 사용합니다.
// 프래그먼트에 맞는 UI를 그릴려면 view를 반환해야 합니다.
// 이 메서드는 프래그먼트 레이아웃의 루트이며 UI를 제공하지 않는 경우 null을 반환합니다.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// 안드로이드스튜디오에서 생성했을 때 만들어짐
// Inflate the layout for this fragment
// return inflater.inflate(R.layout.example_fragment, container, false);
View view = inflater.inflate(R.layout.example_fragment, container, false);
//UI 등을 등록 또는 초기화할때 내용을 추가하면 된다..
return view;
}
//메서드
}