
26 Dec
2011
26 Dec
'11
4:24 a.m.
On Mon, Dec 26, 2011 at 6:37 AM,
I expect this code to do the following: when somebody clicks the button "btn" from record gui, the program draws something, and then waits for 1800000 microsecs (I hope threadDelay is measured in microsecs), and then draws something else. In fact, the code doesnt do this, but waits 1800000+ microsecs, and draws everything at the same time. Is there an error somewhere?
Yes, you should not block the UI thread. Never. If you want your code to behave well, you'll need to do something like adding a timer that goes off after 1.8s or something like that. If you keep blocking your UI thread, you'll have many many headaches. Cheers, -- Felipe.