添加setOnPageChangeListener后程序进不去了
viewPager.setOnPageChangeListener( new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int index, float v, int i1) { for (int i = 0; i < fragments.size(); i++) { llindicator.getChildAt( i ).setBackgroundResource( index==i?R.drawable.dot_focus:R.drawable.dot_normal ); } }