getActionBar() returns null

前端 未结 24 1769
暗喜
暗喜 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:47

    I had the same problem and one of the solutions was to use setContentView() before calling getActionBar().

    But there was another thing that fixed the problem. I specified theme for the application to be @android:style/Theme.Holo.Light.

    
        ...
    
    

    I think any theme, which has true in it, can be used.

提交回复
热议问题