cordova - Splash Screen for android not hiding in PhoneGap -
I am new to mobile app development and phonegrap. When my app starts, I want to show a splash screen and hide it after the device is ready. I am using eclipse.
I have installed the Splash screen plugin for Cordoba. I have followed the tutorials given in PhoneGrap, it is showing a splash screen, but the device is not hidden when it is ready. In addition, after the back button is pressed it does not get released.
Below the /res/xml/config.xml, my config.xml file is:
& lt ;? XML version = '1.0' encoding = 'UTF-8'? & Gt; & Lt; Widget ID = "com.citywide.Citizen" version = "0.0.1" xmlns = "http://www.w3.org/ns/widgets" xmlns: cdv = "http://cordova.apache.org/ns /1.0"> & Lt; Priority name = "loglevel" value = "DEBUG" /> & Lt; Priority name = "splash screen" value = "splash" /> & Lt; Priority name = "splash screen removal" value = "5000" /> & Lt; Priority name = "AutoHeadspace screen" value = "wrong" /> & Lt; Feature Name = "SplashScreen" & gt; & Lt; Param name = "android-package" value = "org.apache.cordova.splashscreen.SplashScreen" /> & Lt; / Feature & gt; & Lt; Name & gt; HelloCordova & lt; / Name & gt; & Lt; Description & gt; A sample Apache Cordoba application that responds to the device's incident & lt; / Description & gt; & Lt; Author Email = "dev@cordova.apache.org" href = "http://cordova.io"> Apache Cordova Team & lt; / Author & gt; & Lt; Content src = "index.html" /> & Lt; Access Basic = "*" /> & Lt; / Widgets & gt;
Below is CordovaApp.java /src/package/CordovaApp.java:
Package package name; Importroid.os.Bundle; Import org.apache.cordova *; Public category Cordova Cordova increases activity {@ Override Public Empty on Create (Instance State Saved from Bundle) {Super. Contents (Saved Instantstate); Super.init (); LoadUrl (launchUrl); Supersat Integerproperty ("SplashScreen", Armwave. Splash); Super.loadUrl ("File: ///android_asset/www/index.html", 5000); }}
Below is my index.html file / set /www/index.html:
& lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" /> & Lt; Meta name = "format-address" content = "telephone = no" /> & Lt; Meta name = "msapplication-tap-highlight" content = "no" /> & Lt ;! - Warning: For iOS 7, remove width = device-width and height = device-height attributeshttp: //issues.apache.org/jira/browse/CB-4323- & gt; See. & Lt; Meta name = "viewport" content = "user-scalable = no, initial-level = 1, maximum-scale = 1, minimum-level = 1, width = device-width, height = device-height, target-density dpi = Device-dpi "/> & Lt; Link rel = "stylesheet" type = "text / css" href = "css / index.css" /> & Lt; Script type = "text / javascript" src = "cordova.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / index.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" charset = "UTF-8" & gt; // Load the device API libraries // load on the function () {document.addEventListener ("deviceready", onDeviceReady, false); Device Readie () {// Now Device API Navigator on Device. Splashscreen.hide () is safe to use; Warning ("here"); }} & Lt; / Script & gt; & Lt; Title & gt; Hello World & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body onload = "onLoad ()" & gt; & Lt; Div class = "app" & gt; & Lt; H1 & gt; Apache Cordova & lt; / H1> & Lt; Div id = "deviceready" class = "blink" & gt; & Lt; P class = "listening to events" & gt; Connecting to the device & lt; / P & gt; & Lt; P class = "get event" & gt; The device is ready & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt;
I'm looking at the alert but the code navigator. Splashscreen.hide () is not hiding it.
Any suggestions or comments would be greatly appreciated!
Comments
Post a Comment