We all know that setting up full screen for activity has a way of setting it in the theme and having it set in the code. So how do you get the current full screen? There are many articles on the Internet using the same method, this method I have been tested basically in the waste level, my is 4.4.4 can't use online spread method. I'll give you an implementation of my own.
/** * @paramactivity *@returndetermine if the current phone is full screen*/ Public Static BooleanIsFullScreen (activity activity) {intFlag =Activity.getwindow (). GetAttributes (). Flags; if(Flag &WindowManager.LayoutParams.FLAG_FULLSCREEN)==WindowManager.LayoutParams.FLAG_FULLSCREEN) { return true; }Else { return false; } }
2 ways to set up a full screen
GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_FULLSCREEN); GetWindow (). Addflags ( WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
GetWindow (). SetFlags (Windowmanager.layoutparams. Flag_fullscreen, windowmanager.layoutparams. Flag_fullscreen); // Full Screen
To cancel a full-screen method
Determine if the current is a vertical screen
/*** Determine if the current screen is horizontal screen *@paramactivity *@return */ Public Static BooleanIsverticalscreen (activity activity) {intFlag =activity.getresources (). GetConfiguration (). Orientation; if(flag = = 0) { return false; }Else { return true; } }
Attached:Android system comes with style
Android:theme= "@android: Style/theme.dialog" displays an activity as a dialog box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, fullscreen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, fullscreen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" uses the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, fullscreen
Android:theme= "translucent" Transparent background
Android:theme= "Theme.Translucent.NoTitleBar" Transparent background with no title
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" Transparent background with no caption, fullscreen
Android:theme= "Theme.panel" Panel style display
Android:theme= "Theme.Light.Panel" tablet style display
Reference from: http://blog.csdn.net/shakespeare001/article/details/7779011
Determines whether the current screen is full screen + whether it is a vertical screen