安卓:BlackScreen的应用 [英] Android: BlackScreen in Application

查看:135
本文介绍了安卓:BlackScreen的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在当我从index1.html移动到index2.html我的应用程序,它显示黑屏,同时retriving大量来自服务器的数据,存储在本地数据库和index2.html的onload事件检索本地数据库中的数据。如何显示进度条,当黑色的屏幕出现或如何删除黑屏?

更新

 <!DOCTYPE HTML>
< HTML和GT;
  < HEAD>
    < META NAME =视CONTENT =用户可扩展性=无/>
    < META HTTP-EQUIV =内容类型内容=text / html的;字符集= UTF-8>
    <标题>登录和LT; /标题>
 <脚本类型=文/ JavaScript的字符集=utf-8SRC =JS / PhoneGap的-1.0.0.js>< / SCRIPT>
    <链接rel =stylesheet属性HREF =master.css类型=文/ CSS媒体=屏幕称号=无题的charset =UTF-8>
    <脚本类型=文/ JavaScript的>功能提交()
{
警报(欢迎);
window.open(index2.html); //在装载时我index2.html所需要的进度条
}
< / SCRIPT>
<风格类型=文/ CSS>
.ex2 {
    边框左上角的半径:10px的;
    边框右上角半径:10px的;
    边框左下角半径:10px的;
    边框右下角半径:10px的;
    边框颜色:#FBB917;
    边框:1px的固体;
   }
    身体 {
        FONT-FAMILY:宋体,日内瓦,宋体,无衬线;
        字体大小:0.8em;
        溢出 - X:隐藏;
    }
    #loadingScreen {
        背景:网址(图像/ Ajax的loader.gif)不重复5像素加上了8px;
        填充左:25像素;
    }
    / *隐藏加载屏幕*密切X /
    .loadingScreenWindow的.ui-对话框的标题栏,关闭{
        显示:无;
    }
  < /风格>
   < /头>
  <身体GT;   < INPUT TYPE =button风格=WIDTH:80%值=提交的onClick =提交()/>
  < /身体GT;
< / HTML>

Android的code

 公共类MobilyzerActivity扩展DroidGap {
    / **当第一次创建活动调用。 * /
    @覆盖
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
      //的setContentView(R.layout.main);
        super.loadUrl(文件:///android_asset/www/index.html);
    }
}


解决方案

如果您使用的是像JQueryMobile框架,那么你必须显示加载对话框的选项。
显示

  $。mobile.showPageLoadingMsg()

隐藏

  $。mobile.hidePageLoadingMsg()

您使用纯HTML?任何框架?

In my application when I move from index1.html to index2.html,It shows black screen while retriving large amount of data from the server, stored in local database and retrieving the data from local database in onload of index2.html.How to show the progress bar when the black screen is appeared or how to remove that black screen?.

update

<!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 code

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

解决方案

If you are using frameworks like JQueryMobile then you have the option of showing loading dialog. showing

$.mobile.showPageLoadingMsg()

hiding

$.mobile.hidePageLoadingMsg()

Are you using plain HTML?? any framework??

这篇关于安卓:BlackScreen的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆