
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 1.39 KB | hits: 12 | expires: Never
Network Thread blocking UI
mainButton=new BitmapButton(Bitmap.getBitmapResource("elcomercio.gif"), Bitmap.getBitmapResource("elcomercio.gif"), Field.FOCUSABLE){
protected boolean navigationClick(int status,int time) {
//It automatically add itself to the screen stack
waitScreen=new WaitScreen();
TimeOutThread timeOut=new TimeOutThread(HomeScreen.this, 10000);
HttpHelper helper=new HttpHelper("http://www.elcomercio.com/rss/latest", null, HomeScreen.this, HttpHelper.GET);
UiApplication.getUiApplication().invokeLater(timeOut);
UiApplication.getUiApplication().invokeLater(helper);
return true;
}
};
public void onTimeout() {
if(!didTimeout.booleanValue()){
UiApplication.getUiApplication().popScreen(waitScreen);
didTimeout=Boolean.TRUE;
}
}
mainButton = new BitmapButton(Bitmap.getBitmapResource("elcomercio.gif"), Bitmap.getBitmapResource("elcomercio.gif"), Field.FOCUSABLE)
{
protected boolean navigationClick(int status,int time)
{
waitScreen = new WaitScreen();
TimeOutThread timeOut=new TimeOutThread(HomeScreen.this, 10000);
HttpHelper helper = new HttpHelper("http://www.elcomercio.com/rss/latest", null, HomeScreen.this, HttpHelper.GET);
timeOut.start();
helper.start();
return true;
}
};