0

我正在使用 kxml 解析器从远程服务器解析 xml。我正在使用以下代码来解析 xml

public void validateUser(String name, String password, String mobile, String code) 
{
    Display.getDisplay(parent).setCurrent(new LoadingBarCanvas(parent));
    ReadXML xmlThread = new ReadXML();
    xmlThread.start();
    int count = 0;
    URL = "http://www.acb.info/mobapp/Web_service/checkLogin.php?mobile=" + mobile + "&userId=dbz&password=123&code=" + code + "&output=xml";
    while (xmlThread.isAlive()) 
    {
        if (count == 0) 
        {
            System.out.println("thread is alive");
        }
        count++;
    }

    StringBuffer sb = new StringBuffer();
    System.out.println("bookVector " + bookVector.size());
    for (int i = 0; i < bookVector.size(); i++) {
        ChapterClass book = (ChapterClass) bookVector.elementAt(i);
        sb.append("\n");
        sb.append("Name : ");
        sb.append(book.getName());
        status = book.getName();
        sb.append("\n");
        sb.append("Descrition : ");
        sb.append(book.getDescription());
        smcID = book.getDescription();
        userName.setString(book.getRating());
                //=book.getRating();
        sb.append("\n");

    }
    System.out.println(sb.toString());


    if (status.equalsIgnoreCase("Sucess..")) 
    {

        StoreData("smcid",smcID);
        StoreData("userid",userName.getString());

        showInputLogInSuccessfull();
    } 
    else 
    {
        showInputLogInFailed();
    }
}

我想在 xml 解析时显示从另一个类加载表单。我试图Display.getDisplay(parent).setCurrent(new LoadingBarCanvas(parent));显示加载表单,但它没有显示加载表单。那么我该如何解决这个问题呢?

4

1 回答 1

1

您可以使用 GIF 文件来加载屏幕

在这里你可以找到示例代码

如果您使用 Netbeans,则转到 library->Add Netbeans MIDP 组件

您将获得 netbeans.splachscreen,netbeans.waitingsceen 类,您可以使用并集成到您的代码中

于 2011-10-07T09:53:16.510 回答