PhoneGap Start Background settings

Source: Internet
Author: User

1. Copy a picture to the drawable-mdpi directory of the Res directory of the Android project

2. Write code in the Java file under the main src

 PackageCom.study.hellomobileword1;ImportAndroid.os.Bundle;//import android.app.Activity;ImportAndroid.view.Menu;ImportOrg.apache.cordova.*; Public classMainactivityextendsdroidgap{@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); //set a background picture        Super. Setintegerproperty ("SplashScreen", R.DRAWABLE.SPLASH_SN); //set timeout Android app if 6 seconds is not reflected it is considered a timeout can be set manually, here 60 seconds to timeout                Super. Setintegerproperty ("Loadurltimeoutvalue", 60000); //The first parameter represents the page that the software initializes, and the second parameter indicates the time that the background picture is displayed (the time millisecond value)        Super. Loadurl ("file:///android_asset/www/index.html", 1000); } @Override Public BooleanOncreateoptionsmenu (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 Start Background settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.