In the MedListActivity, add the below code:
@Override
public void onResume(){
if(viewPager != null && viewPager.getAdapter() != null) {
viewPager.getAdapter().notifyDataSetChanged();
}
}
It should refresh the tabs.
If this is not working, do the below:
Move the Adapter creation mechanism (I assume this is the data you want to display) to a separate method, which will be called in OnCreate. This will not change current behavior.
In the Fragment, override the onResume method and also call this new adapter-creating method.
Summing up our comments discussion, the final solution is adding the following method to the Fragment code:
@Override
public void onResume() {
super.onResume();
// Here we call the data setup methods again, to reflect
// the changes which took place then the Fragment was paused
initializeData();
initializeAdapterpassed();
initializeAdapterup();
}