getActionBar() returns null

前端 未结 24 1248
暗喜
暗喜 2020-11-22 13:31

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

24条回答
  •  盖世英雄少女心
    2020-11-22 13:52

    You have to define window type as actionbar before activity render its view.

    use

    requestWindowFeature(Window.FEATURE_ACTION_BAR);
    

    before calling setContentView() method.

提交回复
热议问题