Make androidProgramAs we all know, the full screen method is static. It is stated at the beginning of the program running. However, if you want to execute an operation while running the program to make it full screen, you still need to exit full screen. How can this problem be solved?
As follows:
- Windowmanager. layoutparams attrs = getwindow (). getattributes ();
- Attrs. Flags | = windowmanager. layoutparams. flag_fullscreen;
- Getwindow (). setattributes (attrs );
- Getwindow (). addflags (windowmanager. layoutparams. flag_layout_no_limits );
Modify the layoutparams parameter of the window and add the flag_layout_no_limits flag to it. Window is automatically displayed in full screen mode.
To exit full screen, you only need to clear the flag_fullscreen parameter that you just added, and then remove the flag_layout_no_limits flag.
As follows:
- windowmanager. layoutparams attrs = getwindow (). getattributes ();
- attrs. Flags & = (~ Windowmanager. layoutparams. flag_fullscreen);
- getwindow (). setattributes (attrs);
- getwindow (). clearflags (windowmanager. layoutparams. flag_layout_no_limits);