You should write a method in the parent (containing the ViewPager and the sub-fragments) like so:
public void setPagerFragment(int a)
{
pager.setCurrentItem(a);
}
This will set the current Fragment in the ViewPager to be the one specified. You can then call this method from the child Fragment with:
int newFrag = 0; //the number of the new Fragment to show
ParentActivity parent = (ParentActivity) getActivity();
parent.setPagerFragment(newFrag);
Regarding sending additional data with the request to show on the new fragment, you can make another method in the parent, to be called in the child, which will set some data in the parent, which the parent can then use when setting the new fragment.
For example in the parent:
public void setExtraData(Object data)
{
dataFromChildFrag = data;
}
And use this in the child like so:
String data = "My extra data"; //the number of the new Fragment to show
ParentActivity parent = (ParentActivity) getActivity();
parent.setExtraData(data);
Finally, if the parent is in fact a Fragment itself rather than an Activity, simply replace all references of:
ParentActivity parent = (ParentActivity) getActivity();
to:
ParentFragment parent = (ParentFragment) getParentFragment();
I hope this helps!