Search code examples
androidandroid-fullscreen

Fullscreen Activity issue in Android 4.3


I updated to 4.3 today and I saw that fullscreen activities are not working properly, more in details, the top bar is always shown.

I tried to run on the emulator (4.2) and works fine.

Anyone has the same problem?


Solution

  • You can do it by two ways

    1) Programatically :

    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);
        }
    }
    

    2) Modifying AndroidManifest.xml file:

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