2015-04-27 94 views
1

我现在用下面的代码回事溅射屏幕为PhoneGap的应用:如何显示启动画面在CordovaActivity

public class MainActivity extends CordovaActivity 
{ 
    @Override 
    public void onCreate(Bundle savedInstanceState) 
    { 
     super.onCreate(savedInstanceState); 
     // Set by <content src="index.html" /> in config.xml 

     loadUrl(launchUrl); 
    } 
} 

config.xml中

<?xml version='1.0' encoding='utf-8'?> 
<widget id="com.example.splashApp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
    <preference name="loglevel" value="DEBUG" /> 
     <feature name="SplashScreen"> 
     <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" /> 
    </feature> 
     <preference name="splashscreen" value="screen" /> 
<preference name="splashScreenDelay" value="10000" /> 

    <feature name="Whitelist"> 
     <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" /> 
     <param name="onload" value="true" /> 
    </feature> 
    <allow-intent href="market:*" /> 
    <name>SplashApp</name> 
    <description> 
     A sample Apache Cordova application that responds to the deviceready event. 
    </description> 
    <author email="[email protected]" href="http://cordova.io"> 
     Apache Cordova Team 
    </author> 
    <content src="index.html" /> 
    <access origin="*" /> 
    <allow-intent href="http://*/*" /> 
    <allow-intent href="https://*/*" /> 
    <allow-intent href="tel:*" /> 
    <allow-intent href="sms:*" /> 
    <allow-intent href="mailto:*" /> 
    <allow-intent href="geo:*" /> 
</widget> 

问题:

splashScreen不会出现尝试很多slove无法修复它任何人都可以帮助我解决这个问题。

尝试:在CordovaActivity

http://cordova.apache.org/docs/en/3.1.0/cordova_splashscreen_splashscreen.md.html#splashscreen.show

Splash screens not working in PhoneGap Build

setIntegerProperty funcation将在3.0七月2013年,我们怎么能使用这个被弃用。

回答

0

只需添加

super.init(); 

到MainActivity

+0

它有什么作用?任何参考? – dakab