0

I have the following problem: I am using a navigation drawer in the MainActivity so this is why I use Fragments.

Some Fragments need Tabs, so I inserted a TabLayout in the AppBarLayout below the Toolbar in the MainActivity.

When using a ViewPager in the Fragment and calling mTabLayout.setupWithViewPager everything works, but only one time. How to setup the TabLayout several times?

Farhad
  • 12,178
  • 5
  • 32
  • 60
  • 1
    do you want to update the data of fragments provided in ViewPager? – Karan Maru Feb 29 '16 at 06:37
  • I have an Activity with the TabLayout and a FrameLayout which I use to replace with Fragments. Some of these fragments contain ViewPager which I want to connect with the TabLayout. But this can only be done one time – Dr Gross Feb 29 '16 at 06:40
  • please refer this http://stackoverflow.com/a/35693193/1944782, for connecting the updating the fragments inside the viewpager. – Karan Maru Feb 29 '16 at 06:44
  • The question is not very clear – Reaz Murshed Feb 29 '16 at 07:19

0 Answers0