Hi I've pseudoinfinite ViewPager
with FragmentStatePagerAdapter
. I dynamically add CalendarFragment
s into it. I have member variable mUpdatedShiftsCont
what is connect point to another inner fragment:
CalendarFragment.java:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.calendar_fragment, container, false);
mCalendarView = (GridView) rootView.findViewById(R.id.calendar);
mUpdatedShiftsCont = (FrameLayout) rootView.findViewById(R.id.calendar_updated_shifts_container);
return rootView;
}
layout.calendar_fragment:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/calendar_fragment_id"
android:orientation="vertical" >
...
<FrameLayout
android:paddingTop="30dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/calendar_updated_shifts_container" />
</LinearLayout>
When I try add inner fragment to connect point,
getFragmentManager().beginTransaction()
.add(mUpdatedShiftsCont.getId(), fragment).commit();
all nested fragments are placed in one parent fragment in ViewPager
:
Does anyone have idea how to solve this? Thanks in advance.