Top Menu

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Saturday 29 November 2014

How to Make an Activity Fullscreen

This code makes the current Activity Full-Screen. No Status-Bar or anything except the Activity-Window!
 
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"/>
 

No comments:

Post a Comment