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\$
3
  • \$\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, 2014 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\$ Feb 21, 2014 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, 2014 at 19:56

3 Answers 3

0
\$\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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .