dimanche 19 avril 2015

getActionBar() returning null

I need my actionbar to be ready before setContentView because it is used by the navDrawerFragment but at this point:



public class BaseActivity extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_ACTION_BAR);
Log.d("", getActionBar().toString());
setContentView(R.layout.activity_base);
}


It is returning null


My theme:



<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/light_blue</item>
<item name="colorPrimaryDark">@color/dark_blue</item>
<item name="colorAccent">@color/dark_blue</item>
<item name="android:windowBackground">@color/white</item>
<item name="android:positiveButtonText">@color/white</item>
<item name="android:windowActionBar">true</item>
</style>


and the declaration at manifest:



<activity
android:name=".controller.activity.BaseActivity"
android:label="@string/app_name" >
</activity>

Aucun commentaire:

Enregistrer un commentaire