code: public static void setFlag(Activity activity, final int bits, boolean on) {
          Window win = activity.getWindow();
          WindowManager.LayoutParams winParams = win.getAttributes();
          if (on) {
              winParams.flags |= bits;
          } else {
              winParams.flags &= ~bits;
          }
          win.setAttributes(winParams);
      }
docs: helper method to activate or deactivate a specific flag
  
  @param bits
  @param on