其实就是自定义一个启动页面,不顾完全可以不用这么做,MainActivity就可以充当启动页面来做,这个是官方的例子就顺便学习一下。同时这里也有延迟加载的例子。
index.html
MainActivity.java
index.html
- <!DOCTYPE html>
- <html>
- <head>
- <title>Splashscreen Example</title>
- <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
- <script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
- //
- document.addEventListener("deviceready", onDeviceReady, false);
- // Cordova is ready
- //
- function onDeviceReady() {
- //navigator.splashscreen.show();
- navigator.splashscreen.hide();
- }
- </script>
- </head>
- <body>
- <h1>Example</h1>
- </body>
- </html>
MainActivity.java
- package com.fanfq.phonegap.splashscreen;
- import org.apache.cordova.DroidGap;
- import android.os.Bundle;
- public class MainActivity extends DroidGap {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // The first line 'super.setIntegerProperty' sets the image to be
- // displayed as the splashscreen. If you have named your image anything
- // other than splash.png you will have to modify this line. The second
- // line is the normal 'super.loadUrl' line but it has a second parameter
- // which is the timeout value for the splash screen. In this example the
- // splash screen will display for 10 seconds. If you want to dismiss the
- // splash screen once you get the "deviceready" event you should call
- // the navigator.splashscreen.hide() method.
- super.setIntegerProperty("splashscreen", R.drawable.splash);
- super.loadUrl("file:///android_asset/www/index.html", 10000);
- }
- }
相关推荐
cordova扫码插件phonegap-plugin-barcodescanner,修复了在ios10上面的内存泄漏导致的闪退bug
phonegap-phonegap-1.8.1-0-gce32a3f.zip
phonegap-phonegap-1.0.0-0-g80cc6dd.zip
jpush-phonegap-plugin 官网上下载的 。。。。。。。。
phonegap-cli, PhoneGap和 PhoneGap/构建 命令行 接口 PhoneGap命令行接口和 node.js 库。命令行命令行要求安装 node.js 版本 >=4.0.0安装 iOS sim 将应用程序部署到iOS模拟器。安装$ npm install
PhoneGap Android is an Android application library that allows for PhoneGap-based projects to be built for the Android Platform. PhoneGap-based applications are, at the core, an application written in...
phonegap-1.8.0-0 phonegap-1.8.0-0
phonegap-android开发,最新版本的phonegap
Phonegap LocalNotification 安卓 消息推送
phoneGap win桌面应用,由于在官网极度难以下载,总心失败告终,所以在此共享下。
ionic2 极光推送插件
Download and install our new PhoneGap Desktop app, which is currently in beta.
phonegap-android-master
FreakDev-PhoneGap-Android-HTML5-WebSocket
最新版本的phonegap-2.9.1是没有cordova-2.9.1.jar的,这里打包好给大家。
websocket-android-phonegap-master
PhoneGap 1.6.0:: Prerequisite Software PhoneGap requires you have the following software installed: 1. Eclipse Integrated Design Environment (IDE), a program to write code and manage software ...
PhoneGap-TestApp-源码.rar