Now in first page fragment i have button and when i click on button i want page two of view pager, **when i click view all it should open womens page which is position2 of viewpager **
Define a method in the Activity (containing the ViewPager and the sub-fragments) like so:
public void setPagerFragment(int a)
{
viewPager.setCurrentItem(a);
}
This will set the current Fragment in the ViewPager to be the one specified. You can then call this method from any child Fragment with:
int newFrag = 0; //the number of the new Fragment to show
ParentActivity parent = (ParentActivity) getActivity();
parent.setPagerFragment(newFrag);