switch System Ui To Lights Out - Android User Interface

Android examples for User Interface:Window

Description

switch System Ui To Lights Out

Demo Code


import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build.VERSION;
import android.view.Display;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import java.lang.reflect.Method;

public class Main{
    @SuppressLint({ "NewApi" })
    public static void switchSystemUiToLightsOut(Window paramWindow) {
        if (Build.VERSION.SDK_INT < 11)
            return;
        WindowManager.LayoutParams localLayoutParams = paramWindow
                .getAttributes();/*from   ww w .j  a v  a 2 s  .  c o  m*/
        localLayoutParams.systemUiVisibility = 1;
        paramWindow.setAttributes(localLayoutParams);
    }
}

Related Tutorials