public class hc_app extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/views/index.html",15000);
}
}
No matter what number I put in super.loadUrl("file:///android_asset/www/views/index.html",15000); it only stays up for a few seconds until the js is loaded I guess, and then it proceeds to my index.html. Now I want the splash screen to stay up indefinitely, so I can hide it when I choose with
navigator.splashscreen.hide();
Alright I think I found something. When I install from eclipse via USB and using my debug keystore, the splash screen only lasts a few seconds. However when I export the app using another keystore and install it ota, the splash screen lasts the correct amount of time! Testing it further now.
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package com.hockeycommunity.hc_app;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.DisplayMetrics;
import org.apache.cordova.*;
public class hc_app extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels; //720
int height = dm.heightPixels; //1280
if(width > 770){
if(width > height){
super.setIntegerProperty("splashscreen", R.drawable.ltsplash); // Landscape tablet
} else {
super.setIntegerProperty("splashscreen", R.drawable.ptsplash); // Portrait tablet
}
} else {
super.setIntegerProperty("splashscreen", R.drawable.splash); // Regular splash
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Lock orientation phone
}
super.loadUrl("file:///android_asset/www/views/index.html",15000);
}
}