Add a Toolbar to a PreferenceActivity

Posted by in Software

When trying to move a playground to Material Design, I stumbled upon the new Toolbar widget, which is supposed to replace the ActionBar (well, that’s my understanding from all the posts I’ve read). Thing is, the Toolbar is designed to be added to an Activity. To do that, the Activity class has a new method public void setActionBar (Toolbar toolbar) since API 21. The problem Adding the Toolbar to an activity is easy and documented in all sources implementing material design on github. However, Adding an action bar to a PreferenceActivity, is nowhere to…read more