How can I disable click on TabLayout in Android

You are accessing tabs before setupWithViewPager, thats why your code is not working. So first set tabs then settouchlistener code.

Try this:

tabLayout.setupWithViewPager(viewPager);
    setupTabIcons();

LinearLayout tabStrip = ((LinearLayout)mTabLayout.getChildAt(0));
    for(int i = 0; i < tabStrip.getChildCount(); i++) {
        tabStrip.getChildAt(i).setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                return true;
            }
        });
    }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)