zoukankan      html  css  js  c++  java
  • phonegap 启动背景设置

    1、拷贝一张图片到Android项目的res目录的drawable-mdpi目录下

    2、在主要的src下的java文件中编写代码

    package com.study.hellomobileword1;
    
    import android.os.Bundle;
    //import android.app.Activity;
    import android.view.Menu;
    import org.apache.cordova.*;
    
    public class MainActivity extends DroidGap{
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            //设置背景图片
            super.setIntegerProperty("splashscreen", R.drawable.splash_sn);
            
            //设置超时 android应用如果  6 秒还没有反映则认为是超时    可以手动设置,这里60秒才超时
            
            super.setIntegerProperty("loadUrlTimeoutValue", 60000);
            
            //第一个参数表示软件初始化启动的页面,第二个参数表示背景图片显示的时间(时间毫秒值)
            super.loadUrl("file:///android_asset/www/index.html",1000);
        }
    
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            getMenuInflater().inflate(R.menu.main, menu);
            return true;
        }
    
    }
  • 相关阅读:
    暂存
    近期学习规划
    将博客搬至CSDN
    后缀自动机五·重复旋律8
    后缀自动机四·重复旋律7
    拓扑排序
    后缀自动机三·重复旋律6
    后缀自动机二·重复旋律5
    交错和(数位dp)
    博弈专题
  • 原文地址:https://www.cnblogs.com/LO-ME/p/4570724.html
Copyright © 2011-2022 走看看