Code example for FragmentActivity

Methods: getWindow

0
	} 
    } 
 
    public void lightsOutMode() { 
	lightsOutMode = true;
	final View rootView = getWindow().getDecorView();
	rootView.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
	rootView.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
 
	rootView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
	    @Override 
	    public void onSystemUiVisibilityChange(int visibility) {
		Log.d(TAG, "" + visibility);
		rootView.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
		rootView.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
	    } 
	}); 
    } 
 
    public void setScreenAlwaysOn() { 
	getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);