Enable action bar on android

Enable action bar on android
0.0 0


I want to enable action bar on android (portrait mode). How can I do it?
I think that it is affected by this line in AndroidManifest.xmp:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

But have no idea how to change it.


It’s currently not trivial possible, because in Cocos2dActivity the layout for the activity is create only by source code. Just changing the the theme won’t help, because you need a layout with a toolbar (preferred from the support library).

Currently your only way is to subclass the Cocos2dActivity and override the init method, which calls setContentView (this tells Android, what to show). You need to wrap the current implementation into a layout file of your choice.

As I said, it’s not that easy, as changing one line of code.

PS: For the future, we should create a layout xml pull request, so the layout can be changed more easily.