Search code examples
androidheaderaccountdrawer

Android Material Drawer remove account header dropdwon


How do I get rid of the dropdown menu that shows connected accounts for an AccountHeader using the Material Drawer library by Mike Penz?

My Current Code:

// Create the AccountHeader
            AccountHeader headerResult = new AccountHeaderBuilder()
                    .withActivity(this)
                    //.withHeaderBackground(R.drawable.header)
                    .addProfiles(
                            new ProfileDrawerItem().withName(displayName).withEmail(email).withIcon(firebaseUser.getPhotoUrl())
                    )
                    .withCompactStyle(true)
                    .withTextColor(getResources().getColor(R.color.itemTextColor))
                    .build();

Solution

  • Fixed it! Added one line...

    .withSelectionListEnabledForSingleProfile(false)