[android-developers] Re: Menu option starts Thread - menu hangs.

2009-03-12 Thread Streets Of Boston
Could you provide a code-snippet showing how you coded the menu- handling and the starting of your thread? On Mar 12, 10:00 am, Ikon ayanafr...@gmail.com wrote: Hi, I am developing a game based on the SurfaceView/LunarLander example in the sample code. I have one activity, with one menu

[android-developers] Re: Menu option starts Thread - menu hangs.

2009-03-12 Thread Ikon
Streets, Here is the snippet where I do the menuHandling: @Override public boolean onOptionsItemSelected(MenuItem item) { switch( item.getItemId()){ case START_GAME: gameThread.doStart(); return true; case STOP_GAME:

[android-developers] Re: Menu option starts Thread - menu hangs.

2009-03-12 Thread Streets Of Boston
I'm assuming that gameThread is something that has its own thread and runs the game. And the main thread (on which onOptionsItemSelected is running) is seperate and handles the user-interface. If so, the it may be that createShapes() is pretty expensive and takes a while. This'll hang the

[android-developers] Re: Menu option starts Thread - menu hangs.

2009-03-12 Thread Ikon
Thanks for the comprehensive response - that is very helpful! What I dont understand is that if I am just telling another thread to go do processing, why would THAT thread not block the main thread then? On Mar 12, 10:52 pm, Streets Of Boston flyingdutc...@gmail.com wrote: I'm assuming that

[android-developers] Re: Menu option starts Thread - menu hangs.

2009-03-12 Thread Ikon
I guess the reason is that ExecutorService.submit must be doing something different than just starting up a new thread? On Mar 12, 10:52 pm, Streets Of Boston flyingdutc...@gmail.com wrote: I'm assuming that gameThread is something that has its ownthreadand runs the game. And the mainthread(on