Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onNavigationItemSelected(MenuItem menuItem) {
- switch (menuItem.getItemId()){
- case (R.id.nav_main):
- getSupportFragmentManager()
- .beginTransaction()
- .replace(R.id.content_frame,MainFragment.newInstance())
- .commit();
- break;
- case (R.id.nav_developmens):
- code from Layout
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.v4.widget.DrawerLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/drawer_layout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fitsSystemWindows="true"
- tools:openDrawer="start">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/content_frame"
- app:layout_behavior="@string/appbar_scrolling_view_behavior">
- <include layout="@layout/ac_main"/>
- </FrameLayout>
- <android.support.design.widget.NavigationView
- android:id="@+id/nav_view"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="start"
- android:fitsSystemWindows="true"
- app:headerLayout="@layout/nav_layout"
- app:menu="@menu/app_main_drawer" />
- </android.support.v4.widget.DrawerLayout>
Add Comment
Please, Sign In to add comment