I have an activation tab and three framgents in it: Activation code: the method is called naturally in the crate:
private void init_slider() { // Creating The Toolbar and setting it as the Toolbar for the activity toolbar = (Toolbar) findViewById(R.id.tool_bar); setSupportActionBar(toolbar); // Creating The ViewPagerAdapter and Passing Fragment Manager, Titles fot the Tabs and Number Of Tabs. adapter = new TabsActionAdapter(getSupportFragmentManager(), Titles, Numboftabs); // Assigning ViewPager View and setting the adapter pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(adapter); // Assiging the Sliding Tab Layout View tabs = (SlidingTabLayout) findViewById(R.id.tabs); tabs.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { } @Override public void onPageScrollStateChanged(int state) { initializeData(); *****Log.w("Initialize Data:","Download initialized");****** } }); tabs.setDistributeEvenly(true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in Available width // Setting Custom Color for the Scroll bar indicator of the Tab View tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() { @Override public int getIndicatorColor(int position) { return getResources().getColor(R.color.tabsScrollColor); } }); // Setting the ViewPager For the SlidingTabsLayout tabs.setViewPager(pager); } Pay attention to the line marked * *
and now logs:
06-17 10:50:33.485 21936-21936/eatgid.com.restaurant W/Initialize Data: Download initialized 06-17 10:50:33.510 21936-21936/eatgid.com.restaurant W/Initialize Data:: Download initialized 06-17 10:50:33.759 21936-21936/eatgid.com.restaurant W/Initialize Data:: Download initialized This is one swipe or click !!! I'm not saying that the onPageScrolled lisenera method is called 10 times with one svaype! where to dig?
and backfilling on the same topic with tabs, I’m not strong in them yet, but I’m frightened by the inscription in the log when svaype:
06-17 10:50:33.762 21936-21936/eatgid.com.restaurant W/FragmentManager: moveToState: Fragment state for Tab3{ffc7800 #2 id=0x7f0c0054 android:switcher:2131492948:2} not updated inline; expected state 3 found 2 Does this mean that I have a jamb somewhere in the code?