how to stop the program for a while?

Hi,

I've created a small prog that the only thing it does is to ask for a given password before granting access to certain data. It works fine on the WTK emulator (from Sun of course), but it crashes on a Nokia 6600 due to a bug in the Nokia's MIDP2.0 implementation. Now I need to trace/find the exact point of the program where it crashes (in the mobile phone - where the app gets closed). MY PROBLEM is that I need to insert into the program some kinda code that stops for a while the program saying "I am at the Nth step and running fine", but I can't stop the program from executing, because I can't find out how, I've tried the

display.setCurrent( someAlert );

but it doesn't seem to stop the program like it would in an HTML JavaScript page. And:

Thread.currentThread().sleep( 2000 );

doesn't stop for some reason the program either..

Can anyone give me a tip or a workaround of how I can temporarily stop the prog? Please help

[984 byte] By [frosen_suna] at [2007-9-24]
# 1

Try putting the current thread to sleep right after setting the alert:

...

yourAlert.setTimeout(3000);

display.setCurrent(yourAlert);

try {

Thread.sleep(3000);

}

catch(...)

Printisora at 2007-7-13 > top of java,Java Mobility Forums,Java ME Technologies...
# 2
Thank you Printisor! It worked :)
frosen_suna at 2007-7-13 > top of java,Java Mobility Forums,Java ME Technologies...
# 3
Glad I could help you :)Mihai
Printisora at 2007-7-13 > top of java,Java Mobility Forums,Java ME Technologies...