码迷,mamicode.com
首页 > 其他好文 > 详细

phonegap 启动背景设置

时间:2015-06-12 06:31:54      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

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;
    }

}

 

phonegap 启动背景设置

标签:

原文地址:http://www.cnblogs.com/LO-ME/p/4570724.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!