How to Set full screen mode for Android

Source: Internet
Author: User

You can set the full screen mode for Android in either of the following ways:ProgramCodeThe other is to configure the manifest. xml file. The second method is recommended.

The <Application> and <activity> labels in the manifest. xml file contain the Android: Theme attribute.

Just add the following XML code.

 
1Android: theme = "@ Android: style/theme. notitlebar. fullscreen"

For example

The following code enables activitydemoactivity to be displayed in full screen mode

<ActivityAndroid: Name= ". Activitydemoactivity"
Android: Label= "@ String/app_name"
Android: Theme= "@ Android: style/theme. notitlebar. fullscreen"
>

The following write rules apply full screen mode.

 <?  XML version = "1.0" encoding = "UTF-8"  ?>   
< Manifest Xmlns: Android = "Http://schemas.android.com/apk/res/android"
Package = "Uni. Activity"
Android: versioncode = "1"
Android: versionname = "1.0" >
< Uses-SDK Android: minsdkversion = "7" />

< Application Android: icon = "@ Drawable/icon" Android: Label = "@ String/app_name"
Android: Theme = "@ Android: style/theme. notitlebar. fullscreen" >

< Activity Android: Name = ". Activitydemoactivity"
Android: Label = "@ String/app_name" >
< Intent-Filter >
< Action Android: Name = "Android. Intent. Action. Main" />
< Category Android: Name = "Android. Intent. Category. launcher" />
</ Intent-Filter >
</ Activity >

< Activity Android: Name = ". Activity01"
Android: Label = "@ String/app_name" >
</ Activity >
</ Application >
</ Manifest >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.