vikramkakkar / SublimeNavigationView

...is a complete rewrite of NavigationView (from Design Support library) that enables - usage of Checkboxes, Switches & Badges as menu items - XML definition - Parcelable menus - collapsible/expandable menu-groups - multiple menus - custom styling.
Apache License 2.0
309 stars 42 forks source link

Cannot remove replace HeaderView1 with with HeaderView2 #29

Open erikswed opened 7 years ago

erikswed commented 7 years ago

Just wanted to have two different HeaderView.xml to switch between but I cannot remove them

Here´s what I try:

        SublimeNavigationView navigate = (SublimeNavigationView) findViewById(R.id.navigation_view);
        if (navigate.getHeaderView() != null)
            navigate.removeHeaderView(navigate.getHeaderView());
        navigate.addHeaderView((View)getLayoutInflater().inflate(R.layout.nav_header, null, false));

This code only add one more HeaderView.xml and display them as a header list Is there some replace method or switsh method to change header?