@Override public void onNavigationDrawerItemSelected(int position) { switch (position) { // SHOW ALL POSTS case 1: if (!blog.getActiveFilter().equals(Blog.FILTER_ALL)) { blog.setActiveFilter(Blog.FILTER_ALL); blog.setCurrentPage(1); } // Force to refresh by changing the title mSectionsPagerAdapter.changeTitle(1, getString(R.string.navigation_drawer_section1)); mViewPager.setCurrentItem(1); actionBar.setTitle(getString(R.string.app_name)); break; // SCROLL TO CATEGORIES case 2: mViewPager.setCurrentItem(0); break; // SCROLL TO AUTHORS case 3: mViewPager.setCurrentItem(2); break; // SHOW FAVOURITES POSTS case 4: if (!blog.getActiveFilter().equals(Blog.FILTER_FAVOURITES)) { blog.setActiveFilter(Blog.FILTER_FAVOURITES); blog.setCurrentPage(1); } // Force to refresh by changing the title mSectionsPagerAdapter.changeTitle(1, getString(R.string.navigation_drawer_section4)); actionBar.setTitle(getString(R.string.navigation_drawer_section4)); mViewPager.setCurrentItem(1); break; // LAUCH DEFAULT EMAIL APP case 5: Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/message"); intent.putExtra(Intent.EXTRA_EMAIL, new String[] {"*****@*****.**"}); intent.putExtra(Intent.EXTRA_SUBJECT, ""); intent.putExtra(Intent.EXTRA_TEXT, ""); Intent mailer = Intent.createChooser(intent, null); startActivity(mailer); break; } }