In my app, I use a MainActivity for storing the main layout (DrawerLayout, with a CoordinatorLayout as content root, with the toolbar and fragment holder in it), and various fragments as screens.
On one particular screen I'd like to expand the ActionBar to a certain size, and give it specific content (remove the toggle button, menu bar, etc., and specify my own layout). It is done by
Yes, in order to remove your custom view and restore the AppCompat ActionBar you can call setDisplayOptions.
getActivity().getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);