0

When opening the navigation drawer, only a few items open, such as nav_home; nav_slideshow etc. However, nav_social, nav_editar, nav_money, nav_login don't work, can someone help me?

Main activity:

mAppBarConfiguration = new AppBarConfiguration.Builder( R.id.nav_home,R.id.nav_social, R.id.nav_gallery, R.id.nav_slideshow, R.id.nav_tools, R.id.nav_share, R.id.nav_send, R.id.nav_editar , R.id.nav_money ) 
.setDrawerLayout(drawer) 
.build();

Activity_main_drawer.xml:

        <item
            android:id="@+id/nav_home"
            android:icon="@drawable/ic_home_black_24dp"
            android:title="Página Principal" />
        <item
            android:id="@+id/nav_social"
            android:icon="@drawable/ic_menu_camera"
            android:title="@string/menu_home" />
        <item
            android:id="@+id/nav_gallery"
            android:icon="@drawable/ic_library_music_black_24dp"
            android:title="@string/menu_gallery" />
        <item
            android:id="@+id/nav_slideshow"
            android:icon="@drawable/ic_location_city_black_24dp"
            android:title="@string/menu_slideshow" />
        <item
            android:id="@+id/nav_tools"
            android:icon="@drawable/ic_location_on_black_24dp"
            android:title="@string/menu_tools" />
        <item
            android:id="@+id/nav_send"
            android:icon="@drawable/ic_videocam_black_24dp"
            android:title="@string/menu_share" />
        <item
            android:id="@+id/nav_money"
            android:icon="@drawable/ic_attach_money_black_24dp"
            android:title="@string/menu_send" />
    
    
    <item android:title="A minha conta">
        <menu>
            <item
                android:id="@+id/nav_editar"
                android:icon="@drawable/ic_edit_black_24dp"
                android:title="Editar Perfil" />
            <item
                android:id="@+id/nav_login"
                android:icon="@drawable/ic_account_circle_black_24dp"
                android:title="Iniciar sessão" />
        </menu>
    </item>

Thank you.

Ryan M
  • 18,333
  • 31
  • 67
  • 74

1 Answers1

0

There may be many reasons why your drawer is not working. If I understand it correctly, you are using Navigation Component for navigation?

  • Have you set fragments to the other options in the navigation map?
  • Can you see something that has been done for the options that work, which hasn't been done for the rest?

We definitely need more details to be able to help you.

Panos Gr
  • 667
  • 5
  • 13
  • How can I set fragments to the other options in the navigation? – FILIPE SILVEIRA Feb 06 '21 at 16:49
  • If you are using Navigation Component, please take a look at Android's [Drawer with Navigation Component Guide](https://developer.android.com/guide/navigation/navigation-ui#add_a_navigation_drawer) and to this excellent [SO explanation](https://stackoverflow.com/a/59304131/4088135) – Panos Gr Feb 07 '21 at 01:06