I\'m having an odd problem. I am making an app with targetsdk 13.
In my main activity\'s onCreate method i call getActionBar()
to setup my actionbar. T
To add to the other answers:
Make sure you call setActionBar()
or setSupportActionBar()
in your onCreate()
method before calling the getActionBar()
:
Define some Toolbar in your activity.xml, then in the onCreate():
Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(toolbar);
// Now you can use the get methods:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);