Guest User

Untitled

a guest
Jan 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. @Override
  2. public boolean onNavigationItemSelected(MenuItem menuItem) {
  3.  
  4. switch (menuItem.getItemId()){
  5. case (R.id.nav_main):
  6.  
  7. getSupportFragmentManager()
  8.  
  9. .beginTransaction()
  10. .replace(R.id.content_frame,MainFragment.newInstance())
  11. .commit();
  12.  
  13. break;
  14.  
  15.  
  16. case (R.id.nav_developmens):
  17.  
  18. code from Layout
  19.  
  20.  
  21. <?xml version="1.0" encoding="utf-8"?>
  22. <android.support.v4.widget.DrawerLayout
  23. xmlns:android="http://schemas.android.com/apk/res/android"
  24. xmlns:app="http://schemas.android.com/apk/res-auto"
  25. xmlns:tools="http://schemas.android.com/tools"
  26.  
  27. android:id="@+id/drawer_layout"
  28. android:layout_width="match_parent"
  29. android:layout_height="match_parent"
  30. android:fitsSystemWindows="true"
  31. tools:openDrawer="start">
  32.  
  33.  
  34. <FrameLayout
  35. android:layout_width="match_parent"
  36. android:layout_height="wrap_content"
  37. android:id="@+id/content_frame"
  38. app:layout_behavior="@string/appbar_scrolling_view_behavior">
  39.  
  40. <include layout="@layout/ac_main"/>
  41.  
  42. </FrameLayout>
  43.  
  44.  
  45.  
  46. <android.support.design.widget.NavigationView
  47. android:id="@+id/nav_view"
  48. android:layout_width="wrap_content"
  49. android:layout_height="match_parent"
  50. android:layout_gravity="start"
  51. android:fitsSystemWindows="true"
  52. app:headerLayout="@layout/nav_layout"
  53. app:menu="@menu/app_main_drawer" />
  54.  
  55.  
  56. </android.support.v4.widget.DrawerLayout>
Add Comment
Please, Sign In to add comment