android - AppCompat ActionBar restoring original layout -


in app, use mainactivity storing main layout (drawerlayout, coordinatorlayout content root, toolbar , fragment holder in it), , various fragments screens.

on 1 particular screen i'd expand actionbar size, , give specific content (remove toggle button, menu bar, etc., , specify own layout). done mainactivity.toolbar.setcustomview();. works pretty well, when navigate different fragment, i'd restore original layout. there simple way of doing this?

yes, in order remove custom view , restore appcompat actionbar can call setdisplayoptions.

getactivity().getactionbar().setdisplayoptions(actionbar.display_show_title | actionbar.display_show_home); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -