Android – Making activity full screen with status bar on top of it

I know that the guy asking the question may have found his own solution but for the people who are still looking for a solution this is a very simple solution but one thing it has a limitation till Kitkat so a condition is added if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); }

Make a SurfaceView larger than the screen (Fitting a camera preview to a SurfaceView larger than the display)

First, remove source of crashes: startPreviewCamera called in onResume. Camera preview shall be started in SurfaceHolder.Callback methods. Then you should know that you can set preview size only to sizes reported by Camera.Parameters.getSupportedPreviewSizes. And these sizes will most likely be smaller or equal to device’s screen size. Then you simply call Camera.Parameters p = camera.getParameters(); … Read more

Android: making a fullscreen application

You are getting this problem because the activity you are trying to apply the android:theme=”@android:style/Theme.Holo.Light.NoActionBar.Fullscreen”> to is extending ActionBarActivity which requires the AppCompat theme to be applied. Extend your activity from Activity rather than from ActionBarActivity You might have to change your Java class accordingly little bit. If you want to remove status bar too … Read more

Immersive mode navigation becomes sticky after volume press or minimise-restore

The following code works for me: public void updateUI() { final View decorView = getWindow().getDecorView(); decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } } }); } And called the listener on onCreate and … Read more