2015-04-27 89 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