I want to create game using Libgdx engine. It's create by default FULLSCREEN game without notification bar.
Can i create game with notification bar?
Since I am not (yet) allowed to comment I will make it an answer. Basically everything said by LiamJPeters helps, except you have set up the project recently from scratch with one of the newer libgdx nightlies, then there will also be a "res/values/styles.xml" which is referenced in the manifest.
I had to change two settings there (in addition to everything written by LiamJPeters) to make it finally show the notification bar and the window title:
<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">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowFullscreen">false</item>
</style>
</resources>
In the Android starter:
public class MainActivity extends AndroidApplication {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.hideStatusBar = false;
initialize(new MainClass(), cfg);
}
}
The important line here being cfg.hideStatusBar = false;
Hope that helps
EDIT
Ok so I've done a bit of research on the subject and it turns out it's pretty easy. I looked on the libgdx wiki page for adding admob ads. Follow all the steps except adding the ads!
Below is modified code for setting up a non-fullscreen android app:
public class MainActivity extends AndroidApplication {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RelativeLayout layout = new RelativeLayout(this);
layout.addView(initializeForView(new MainClass(), false));
setContentView(layout);
}
}
You can add all the layout parameters you want very easily by googleing "RelativeLayout layoutParams". Hope this helps. Please mark the question as answered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With