I ran into confusion here and couldn't get it to work for a while on Android Lollipop. I had to actually combine all the code given here in the answers to show the status bar of the application.
So, the final working code for me is as follows:
Part of Java is combining the relative layout and configuration of hideStatusBar (thanks to LiamJPeters)
protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); config.hideStatusBar = false; RelativeLayout layout = new RelativeLayout(this); layout.addView(initializeForView(new MyAndroidApp(), config)); setContentView(layout); }
And styles.xml part - windowFullscreen to false (thanks Bernrd K.)
<resources> <style name="GdxTheme" parent="android:Theme"> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation</item> <item name="android:windowNoTitle">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowFullscreen">false</item> </style> </resources>
Note: windowNoTitle has nothing to do with the status bar. Depends on what you need, but the xml above only shows the status bar, no headers.
source share