astuetz / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
139 stars 44 forks source link

scrollToChild() - FATAL EXCEPTION: main PID: 1809 java.lang.NullPointerException #274

Open JosephPrince opened 8 years ago

JosephPrince commented 8 years ago

I was making dynamic tabs, ie tab size and names varies each time, it is working fine for first couple of time after that scrollToChild() - FATAL EXCEPTION: main PID: 1809 java.lang.NullPointerException Occurs on line scrollToChild(position, (int) (positionOffset * tabsContainer.getChildAt(position).getWidth()));

zuoguodang commented 8 years ago

I've had the same problem as you.I solved it. 1、tab.notifyDataSetChanged(); 2、adapter.notifyDataSetChanged();