@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayShowTitleEnabled(false); TextView text = (TextView) findViewById(R.id.toolbar_title); Typeface tf = Typeface.createFromAsset(getAssets(), "MotionPicture_PersonalUseOnly.ttf"); text.setTypeface(tf); // Creating The ViewPagerAdapter and Passing Fragment Manager, Titles fot the Tabs and Number Of // Tabs. adapter = new ViewPagerAdapter(getSupportFragmentManager(), Titles, Numboftabs); // Assigning ViewPager View and setting the adapter pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(adapter); // Assiging the Sliding Tab Layout View tabs = (SlidingTabLayout) findViewById(R.id.tabs); tabs.setDistributeEvenly( true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in // Available width // Setting Custom Color for the Scroll bar indicator of the Tab View tabs.setCustomTabColorizer( new SlidingTabLayout.TabColorizer() { @Override public int getIndicatorColor(int position) { return getResources().getColor(R.color.tabsScrollColor); } }); // Setting the ViewPager For the SlidingTabsLayout tabs.setViewPager(pager); // Initialize Drawer mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); // Intialize listner mDrawerToggle = new ActionBarDrawerToggle( this, mDrawerLayout, toolbar, R.string.app_name, R.string.app_name); // Setting Listner to drawer mDrawerLayout.setDrawerListener(mDrawerToggle); // getSupportActionBar().setDisplayHomeAsUpEnabled(true); // getSupportActionBar().setHomeButtonEnabled(true); mDrawerToggle.syncState(); drawerFragment = (DrawerFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_drawer); drawerFragment.setUp( R.id.fragment_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), toolbar); drawerFragment.setDrawerListener(this); // displayView(0); }