I am sure you have created an adapter by extending PageAdapter, so there is one method:
@Override
public void destroyItem(View collection, int position, Object view) {
((ViewPager) collection).removeView((View) view);
}
For detailed example for the same, just go through this example.