Copied essentials from ActionBarSherlock.