title: Tablayout inside another tablayout
body: <p>Sir,I have a tablayout with 4 fragment.In one of those fragments i want one more tablayout to show furthur subpages but as soon as i initialise tablayout inside fragment it gives an exception.Is their any way to do so or any another alternative to meet my demands.</p>
  
  <pre><code>public class Fragment4 extends Fragment {
  RecyclerView recyclerView;
  ArrayList&lt;String&gt; arrayList;
  TabLayout tabLayout;
  ViewPager viewPager;
  // TextView textView;
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      View v=inflater.inflate(R.layout.fragment4,container,false);
  
      tabLayout= (TabLayout) v.findViewById(R.id.tabLayout2);
      viewPager = (ViewPager) v.findViewById(R.id.pagers);
      ViewAdapter adapter = new            ViewAdapter(getActivity().getSupportFragmentManager());
      viewPager.setAdapter(adapter);
  
      tabLayout.setupWithViewPager(viewPager);
      TabLayout.Tab news = tabLayout.newTab();
      TabLayout.Tab Chats = tabLayout.newTab();
      TabLayout.Tab Contacts = tabLayout.newTab();
      TabLayout.Tab Notes = tabLayout.newTab();
      news.setText("News Feed");
      Chats.setText("Chats");
      Contacts.setText("Contacts");
      Notes.setText("Notes");
      tabLayout.addTab(news, 0);
      tabLayout.addTab(Chats, 1);
      tabLayout.addTab(Contacts, 2);
      tabLayout.addTab(Notes, 3);
      tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
      tabLayout.setTabTextColors(ContextCompat.getColorStateList(getActivity(), R.color.mdtp_button_color));
      tabLayout.setSelectedTabIndicatorColor(ContextCompat.getColor(getActivity(), R.color.colorAccent));
      viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
      return v;
  
  
  }
  
  
  }
  </code></pre>
  
  <hr>
  
  <p>here is my stacktrace:</p>
  
  <pre><code>FATAL EXCEPTION: main
  Process: com.example.shivambhusri.fireapp, PID: 3543
       java.lang.ClassCastException: android.widget.TableLayout cannot be cast to android.support.design.widget.TabLayout
       at com.example.shivambhusri.fireapp.Fragment4.onCreateView(Fragment4.java:42)
       at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
       at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
       at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
       at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
       at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:164)
       at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
       at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
       at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:551)
       at android.support.design.widget.TabLayout$ViewPagerOnTabSelectedListener.onTabSelected(TabLayout.java:2008)
       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
       at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
       at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
       at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
       at android.view.View$PerformClick.run(View.java:20329)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5912)
       at java.lang.reflect.Method.invoke(Native Method)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
  </code></pre>