Solve the problem that applications developed on Android tablets cannot be displayed in full screen.

Source: Internet
Author: User

When developing apps (game programs) on an Android tablet with an 8-inch screen, the app cannot be displayed in full screen or configured in the first place.

Originally, the LCD should be 800*600, but always get the result of 600*600.

After several days of hard work, we can solve the problem:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="myb.x2.app2"      android:versionCode="1"      android:versionName="1.0">    <application android:icon="@drawable/icon" android:label="@string/app_name">        <activity android:name=".myactivity"          android:screenOrientation="portrait"                  android:label="@string/app_name">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>    </application>  <supports-screens android:largeScreens="true"          android:normalScreens="true"          android:smallScreens="true"          android:anyDensity="true" /></manifest> 

 

<Supports-screens Android: largescreens = "true "... /> you can solve this problem, but it takes me a long time to find a solution to this problem.

Code in activity:

Public class myactivity extends Activity {public myview v;/** Called when the activity is first created. * // @ Override public void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); // setContentView (R. layout. main); requestWindowFeature (Window. FEATURE_NO_TITLE); getWindow (). setFlags (WindowManager. layoutParams. FLAG_FULLSCREEN, WindowManager. layoutParams. FLAG_FULLSCREEN); // obtain the screen width and height. WindowManager windowManager = getWindowManager (); Display display = windowManager. getdefadisplay display (); int w = display. getWidth (); int h = display. getHeight (); v = new myview (this, w, h); setContentView (v); v. start ();}}
Related Article

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.