Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is Flags used for?

Tags:

android

flags

Would someone explain me the role of flags in functions like setFlags? What exactly does this word mean in that situation...?

My example is

protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(new RenderView(this));
}

I'd like to know what is setFlags used for?

I've read the API documentation, but I haven't understood that.

like image 945
Hellon Canella Machado Avatar asked Feb 19 '14 03:02

Hellon Canella Machado


1 Answers

Simply think of flags as features that you're applying to the object (in this case to the object Window), and they are represented as integers. You can apply the flags using the final variables in Window and WindowManager.LayoutParams.

setFlags replaces current flags. addFlags appends more flags and does not replace the current ones.

like image 96
u3l Avatar answered Sep 28 '22 16:09

u3l