J
JScoobyCed
Hi,
I have a MiDlet that starts a Thread through a Runnable, in which
there is IO activity:
Runnable runner = new Runnable() { // some IO stuff there };
Thread thd = new Thread(runner);
thd.start();
The application runs well, until I need to close the IO channels that
are opened in that separate Thread.
Of course, I catch the IOException in my Thread, and the Thread
completes properly (and dies...).
But after this catch, the UI is not responding: if I press a button the
menu will not show, and if I do some programmaticaly changes in the UI
it does not display and the call blocks (i.e. if I add an item in the
current screen, nothing happens and the next line --System.out.println--
doesn't execute).
I know the application didn't die, cause I have another Thread running a
'while' loop and printing "I am alive!" even when the UI freezes.
And also if I don't perform UI changes I can print stuff in the main Thread.
Any idea to help me ? Thank you.
I have a MiDlet that starts a Thread through a Runnable, in which
there is IO activity:
Runnable runner = new Runnable() { // some IO stuff there };
Thread thd = new Thread(runner);
thd.start();
The application runs well, until I need to close the IO channels that
are opened in that separate Thread.
Of course, I catch the IOException in my Thread, and the Thread
completes properly (and dies...).
But after this catch, the UI is not responding: if I press a button the
menu will not show, and if I do some programmaticaly changes in the UI
it does not display and the call blocks (i.e. if I add an item in the
current screen, nothing happens and the next line --System.out.println--
doesn't execute).
I know the application didn't die, cause I have another Thread running a
'while' loop and printing "I am alive!" even when the UI freezes.
And also if I don't perform UI changes I can print stuff in the main Thread.
Any idea to help me ? Thank you.