Open Vic003 opened 7 years ago
I tried this and it is working perfectly.
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { Toast.makeText(getActivity(),"Selected :" +String.valueOf(position),Toast.LENGTH_SHORT).show(); } @Override public void onPageScrollStateChanged(int state) { } });
hello there, firstly thanks for this attractive sliding tab, I implemented your codes in my college project , the slides where working beautifully. But now when i swipe on screens it is showing diffrent details means: tab at 0 index is showing index 1.
codes are below here:
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_enquiry, container, false); context = getActivity();
/* Here it is showing the correct information.
*/
public class FragmentEnquirySlidingTab extends Fragment {
//here it is showing diffrent values from Tab
}
please help me out