I am getting issue with ViewPager. I am using FragmentActivity and I added the multiple fragment inside FragmentActivity as following method.
public void addFragment(Fragment fragment, boolean addToBackStack, int transition) {
FragmentTransaction ft = getFragmentManager().beginTransaction().setCustomAnimations(R.anim.slide_up,R.anim.slide_down,R.anim.slide_up,R.anim.slide_down);
ft.replace(R.id.main, fragment);
ft.setTransition(transition);
if (addToBackStack)
ft.addToBackStack(null);
ft.commit();
}
I am using ViewPager Inside the fragment. ViewPager is working fine when FragmentActivity loaded. but when i use another fragment ViewPager got invisible.
for example
a.) Fragment A with ViewPager
b.) Fragment B without ViewPager
Fragment A working fine when I run App. when i go to Fragment B then I again i replace Fragment B to Fragment A then ViewPager is not working. I see the blank view where I am using ViewPager.
Please let me know How can i solve this issue
Thanks