Code example for Window

Methods: addFlags, clearFlags

0
	 
	public void show() { 
		setVisibility(VISIBLE);
		if(activity != null) {
			Window win = activity.getWindow();
			win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
	        win.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
		} 
		clearLockTasks(); 
	} 
	 
	public void hide() { 
		setVisibility(GONE);
		if(activity != null) {
			Window win = activity.getWindow();
			win.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
	        win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
		} 
		clearLockTasks(); 
		reset(); 
	}