multithreading - Android SurfaceView Thread with multiple activities -


i have thread part of surface view object:

public class gamearena extends surfaceview implements surfaceholder.callback {       private gamethread thread = null;       // etc } 

and surface view part of activity.

later when user clicks screen, new activity launched, own different surface view.

the problem have finding how/when cancel thread when user press' home button in second activity, when start app again thread exists.

many thanks

you should not have thread created within surfaceview, instead should create thread within activity owns surfaceview. in addition, synchronization needed between thread , activity thread life cycle.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -