Programmatically make app FULL SCREEN in Android

android, android-activity, android-layout

Solution

add two lines...

requestWindowFeature(Window.FEATURE_NO_TITLE); 
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);

Problem

I know that an app can be made full screen by tag in the manifest of the activity `android:theme="@android:style/Theme.NoTitleBar.Fullscreen"` Is it possible to switch to full screen mode from within the app, programmatically?

Original source