public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
Bundle args = new Bundle(); // 번들 생성
args.putInt(ARG_SECTION_NUMBER, position);
//프래그먼트를 생성
//TODO: 2번화면 화살표 생성 플래그
if(position == 2){
args.putInt("arrow_flag", true);
}
..이하생략
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final int position = getArguments().getInt(ARG_SECTION_NUMBER);
final boolen flag = getArguments().getBoolean("arrow_flag");
View rootView = inflater.inflate(R.layout.fragment_sub2, container, false);
//TODO:화살표 추가된 레이아웃
if(flag){
View rootView = inflater.inflate(R.layout.fragment_sub2_arrow, container, false);
}
..이하생략