Set System Window sticky Immersion - Android User Interface

Android examples for User Interface:Window

Description

Set System Window sticky Immersion

Demo Code


//package com.java2s;
import android.annotation.TargetApi;

import android.os.Build;
import android.view.View;

public class Main {
    private static View view;

    @TargetApi(Build.VERSION_CODES.KITKAT)
    public static void stickyImmersion() {
        int uiOption = 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;

        view.setSystemUiVisibility(uiOption);
    }//w  w w .  ja va2  s .  c o m
}

Related Tutorials