Hi,
I am creating an application that downloads XML content and parse it. Now I want to add progress bar to the application while it is downloading content. I am adding a screen with gauge field and starting a thread for downloading.
As soon as download is complete I remove the progress bar screen and add another screen to display downloaded data. Following code wait for download to complete and then display the downloaded data.
If I move "theApp.enterEventDispatcher() " above "downloadThread.start()" line then it displays progress bar only and stop processing following events.
Code:
theApp.pushScreen(theApp.getGaugeScreen());
theApp.downloadThread.start();
while(theApp.downloadThread.isAlive()) {
// Some code
}
theApp.popScreen(theApp.getGaugeScreen());
theApp.pushScreen(theApp.getDisplayController().getMainScreen());
theApp.enterEventDispatcher();
What is correct way to display progress bar and do other process? I am not able to find good example code to help me. I am new to J2ME.
Thanks