Currently, using HTML5 + JavaScript + css3 with the phonegap framework to develop apps and games on Android or IOS systems has become a possibility. In the past two days, I have developed a small leisurely game using HTML5, using phonegap to package it into an APK and run it on an Android phone, but it cannot be full screen. After thinking for a long time, the solution will be solved...
At the beginning, I had always guessed that it was a problem with the android activity configuration. So I went to the android activity full-screen configuration method and the result still failed.
The configuration code in activity is:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
When you see that the view activity is inheritedDroidgapm, Instead of activity, I suddenly realized that, alas, it's really B !!! Haha, brother is also the first contact with phonegap, hope to understand...
Paste the Code directly:
/*** File name: noteactivity. java * Creator: Li hangjie * creation date: 01:39:21 */public class noteactivity extends droidgap {/** called when the activity is first created. * // @ override public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setfullscreen (); super. loadurl ("file: // android_asset/web/app.html");}/*** full screen (no title bar or status bar) */Public void setfullscreen () {getwindow (). clearflags (windowmanager. layoutparams. flag_force_not_fullscreen); // clear the flag requestwindowfeature (window. feature_no_title); getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );}}
Note: When loading a URL page, you must configure its view form attributes. Therefore, you must put them in the first line.