What are flags used for?

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

My example

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 would like to know what setFlags are used for?

I read the API documentation, but I did not understand this.

+4
source share
3 answers

Just think of the checkboxes as functions that you apply to the object (in this case, the object Window), and they are represented as integers. You can apply flags using trailing variables in Windowand WindowManager.LayoutParams.

setFlagsreplaces the current flags. addFlagsAdds more flags and does not replace the current ones.

+4
source

setFlag() , ,

Window flag, Intent flag etc..

, ,

for Intent Flag

mintent.setFlag(Intent.FLAG_ACTIVITY_CLEAR_TOP); 

, , .

+1

, , . , .. , , , , ... .., , , , setContentView, , setContentView. , , , : http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

0
source

Source: https://habr.com/ru/post/1527626/


All Articles