getSupportActionbar
In my manifest I use following theme:
<activity
android:name="x.x.MainActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.Sherlock.NoActionBar">
In my onCreate I have following:
setTheme(R.style.Theme_Sherlock);
this.getSupportActionBar().setTitle(R.string.title_activity_main);// <-- this will crash on android 2.3 and below, will work fine on ice cream sandwich, the supportactionbar is null as the theme haven't been updated.
// Start regular onCreate()
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
This would be nice if it worked because it would be possible to be free of the pre action bar before the activity is started.