2012-05-08 50 views
0

在我的應用程序中,當我從index1.html移動到index2.html時,它顯示黑屏,同時從服務器獲取大量數據,存儲在本地數據庫中,並在onload中從本地數據庫中檢索數據index2.html。如何在黑屏出現時顯示進度條或如何刪除黑屏?Android:應用程序中的黑屏

更新

<!DOCTYPE HTML> 
<html> 
    <head> 
    <meta name="viewport" content="user-scalable=no" /> 
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
    <title>Login</title> 
<script type="text/javascript" charset="utf-8" src="js/phonegap-1.0.0.js"></script> 
    <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"> 
    <script type="text/javascript"> 

function submit() 
{ 
alert("welcome"); 
window.open("index2.html");//while loading index2.html i need the progress bar 
} 
</script> 
<style type="text/css"> 
.ex2{ 
    border-top-left-radius: 10px; 
    border-top-right-radius: 10px; 
    border-bottom-left-radius: 10px; 
    border-bottom-right-radius: 10px; 
    border-color:#FBB917; 
    border: 1px solid; 
    } 
    body { 
     font-family:Arial,Geneva,Verdana,sans-serif; 
     font-size: 0.8em; 
     overflow-x: hidden; 
    } 
    #loadingScreen { 
     background: url(images/ajax-loader.gif) no-repeat 5px 8px; 
     padding-left: 25px; 
    } 
    /* hide the close x on the loading screen */ 
    .loadingScreenWindow .ui-dialog-titlebar-close { 
     display: none; 
    } 
    </style> 
    </head> 
    <body > 

    <input type="button" style="width:80%" value="Submit" onClick="submit()"/> 
    </body> 
</html> 

的Android代碼

public class MobilyzerActivity extends DroidGap { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     // setContentView(R.layout.main); 
     super.loadUrl("file:///android_asset/www/index.html"); 
    } 
} 
+0

發佈您的代碼片段,我們將幫助您.. –

+0

@Andro我已更新我的代碼 – Ela

+0

您是否在index2.html頁面再次調用phonegap腳本? –

回答

0

如果您使用的是像JQueryMobile框架,那麼你必須顯示加載對話框中的選項。 顯示

$.mobile.showPageLoadingMsg() 

躲在你使用普通的HTML

$.mobile.hidePageLoadingMsg() 

?任何框架?

+0

我已更新我的代碼。 – Ela