Trying to move over my stuff to use Toolbar
instead of action bar but I keep getting an error saying
java.lang.RuntimeException: Unable to start
To use Toolbar as an Action Bar, first disable the decor-provided Action Bar.
The easiest way is to have your theme extend from
Theme.AppCompat.NoActionBar
(or its light variant).
Second, create a Toolbar instance, usually via your layout XML:
Then in your Activity or Fragment, set the Toolbar to act as your Action Bar:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.blah);
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
setSupportActionBar(toolbar);
}
This code worked for me.