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

PHP while loop dynamic rowspan -

android - How to read a column value in parse.com without accessing an object or a pointer -

timer - Java TimerTask cancel -