可能重复:
黑莓 - 应用程序加载屏幕
请等待应在单击时显示,然后应加载数据。加载数据后,pleasewait poup 应该被关闭..如何实现它?代码:1.在SplashScreen的末尾:
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
try
{
Thread.sleep(2000);
}
catch (InterruptedException e)
{
Dialog.alert(e.getMessage());
}
UiApplication.getUiApplication().popScreen(SplashScreen.this);
UiApplication.getUiApplication().pushScreen(new ListScreen1());
}
}
);
2.列表屏幕1
class ListScreen1 extends MainScreen
{
//
//
//
public ListScreen1()
{
ObjectListField lf = new ObjectListField()
{
protected boolean navigationClick(int status, int time)
{
return true;
//HttpRequest
//push(new ListScreen2)
}
};
//httpRequest
//addlist
}
class ListCallBack implements ListFieldCallback
{
public void drawListRow(final ListField list, final net.rim.device.api.ui.Graphics g, final int index, final int y, final int w)
{
//
}
public Object get(ListField list, int index)
{
//return
}
public int getPreferredWidth(ListField list)
{
//return
}
public int indexOfList(ListField listField, String prefix, int start)
{
//return
}
}
}
3.列表屏幕2:
class ListScreen2 extends MainScreen
{
//
//
//
public ListScreen2()
{
ObjectListField lf = new ObjectListField();
/httpRequest
//addlist
}
class ListCallBack implements ListFieldCallback
{
public void drawListRow(final ListField list, final net.rim.device.api.ui.Graphics g, final int index, final int y, final int w)
{
//
}
public Object get(ListField list, int index)
{
//return
}
public int getPreferredWidth(ListField list)
{
//return
}
public int indexOfList(ListField listField, String prefix, int start)
{
//return
}
}
如何管理请在这些课程之间等待?请帮忙