views:

58

answers:

1

Hi, I have an activity which has a thread and a view in it...they're suspiciously similar to LunarLander. To show an in-game menu, i'm calling the startActivityForResult for a different activity which has a number of buttons on it...this is then returning the button type pressed to the parent activity. This is fine except when I carry on in the parent activity, the original thread I had is now TERMINATED. I guess this is happening because the parent activity has lost focus and so the thread is considered dead, but I want to carry on with the thread.

Is there any way I can keep the thread alive? I've tried setFlags on the intent for the new activity but i've not found anything that maintains it..

A: 

I gave up and decided to cheat. Instead of trying to return to the parent from the child activity, i'm recreating the parent activity again.

So my gameActivity creates the menuActivity and then is scrapped using the inGameMenuIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); flag. Then the menuActivity does its stuff and when a button is pressed it creates a new gameActivity and menuActivity is scrapped.

Fletch