My pager adapter ( extends PagerAdepter ) has a textview in it. And I update this textview with MainActivity\'s onPageSelected . Its update textview for position > 0 , but start
Because I did what was suggested here and it did not work I will post what did work for me was adding the instantiating function to onPageScrolled, like so:
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
adapter.closeText(arg0, viewPager);
}
Probably the reason it worked is that onPagesScrolled is activated farther down the line of the android task manager, so we prevent the unwanted situation where the page is inflated with skipping the listeners attachment to the view.