i am working with ViewPager + TabLayout. It was working fine, but after i added navigation bar, the TabLayout is not showing tabs. I searched for solution but none of them helped. It will be really helpful if anyone tells me why this happened.
MainActivity.java
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
SimpleFragmentPageAdapter adapter = new SimpleFragmentPageAdapter(this, getSupportFragmentManager());
viewPager.setAdapter(adapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
content_main.xml
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
style="@style/CategoryTab"
android:background="@color/colorPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextColor="#ddd"
app:tabSelectedTextColor="#fff" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:background="#fff"
android:layout_width="match_parent"
android:layout_height="match_parent"/>