0
\$\begingroup\$

I am trying to use the LibGDX UI Project creator to create LibGDX projects, but it doesn't allow me to choose the Andorid version for the project. This is a problem for some android features. For example I want to hide the action bar, so I wanted to set the Theme:

Theme.Holo.Light.NoActionBar.Fullscreen

...but if I do that I get the error message

@android:style/Theme.Holo.Light.NoActionBar.Fullscreen requires API level 13 (current min is 5).

My idea is to manually set up the projects so I can choose freely the versions and API levels. But I think I can't choose what I want, because then LibGDX would have problems.

How can I correctly set the android version using UI Project creator?

\$\endgroup\$
  • \$\begingroup\$ you can set the android required version higher than the minimum required version for libgdx. just change the target and minimum android versions in the androidmanifest file \$\endgroup\$ – wes Feb 21 '14 at 17:37
  • \$\begingroup\$ Oh, sry I mean the navigation bar, how I can disable it ? I tried it with this: View decorView = getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN; decorView.setSystemUiVisibility(uiOptions); But if I touch near the zone its shown again... \$\endgroup\$ – user2933016 Feb 21 '14 at 18:36
  • \$\begingroup\$ If a response answers your question, please select it as the answer so other users that find your question may see the answer you used. \$\endgroup\$ – wes Feb 21 '14 at 19:56
1
\$\begingroup\$

As per your comment, you should probably rephrase your question if all you're trying to do is remove the navigation/title bar..

https://stackoverflow.com/a/2868052/1620568

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class ActivityName extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // remove title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
    }
}

Or you can do it via your AndroidManifest.xml file:

<activity android:name=".ActivityName"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
</activity>
\$\endgroup\$
1
\$\begingroup\$

You are probably developing with the ADT. To change the API you are working with, download the newest one with the Android SDK Manager and change the project.properties target=android-19.

That might fix it.

\$\endgroup\$
0
\$\begingroup\$

From one of your comments I saw that you meant to disable the navigation bar. Well this will keep it out of the screen until you swipe down from the status bar. It's the same code that Jetpack Joyride uses:

View decorView = getWindow().getDecorView(); 
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decorView.setSystemUiVisibility(uiOptions);

You must also have this in the activity section of your XML file:

android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.