I am using the TabLayout found in the Service library. I have tried to add an OnLongClickListener when long-clicking on a tab. It has been impossible for me. I have even been trying to "hack" it by using childViews:
View tabLayoutChild = tabLayout.getChildAt(0);
ViewGroup group = (ViewGroup) tabLayoutChild;
group.getChildAt(0).setOnLongClickListener(this);
Doesn't work and does NOT look pretty. It is all very handy except for the longClick I want to implement.
My small snippet of code
pagerAdapter = new CustomFragmentPagerAdapter(getSupportFragmentManager());
pagerView.setAdapter(pagerAdapter);
tabLayout.setupWithViewPager(pagerView);
The tablayout has a method setOnLongClickListener()
but what I can tell, it does nothing.
How can I implement a LongClickListener for a tab in a tablayout?