Views (except SurfaceView's surface) can NOT be used from background threads. Besides, it would not help at all.
On Sun, Mar 8, 2009 at 8:38 PM, kbeal10 <[email protected]> wrote: > > I'm currently designing a game that will be displaying several dice. I > would like to know the wisest course of action. The dice will extend > View (or SurfaceView), so that each will be able to be touched, etc. > My question is should I: > > A.) Spawn one child thread to draw all of the dice (up to 6). I would > do this by writing a class that extends ViewGroup or one of the > Layouts and having it create a new thread. Or... > > B.) should I spawn a new thread for each die? Each die would extend > View, or possibly SurfaceView and have its own thread to perform the > onDraw() (i.e. the LunarLander example). > > Which solution would yield better performance/responsiveness? Would up > to 6 child threads be necessary, or a detriment? > > I'm asking because I understand how I would implement the B.) solution > already. It closely follows the LunarLander example and I have already > implemented another section of the game in the same fashion. Other the > other hand, creating up to 6 child threads seems like it may be a bit > much on resources. However, I am unsure how I would implement a > ViewGroup that does its work in a child thread. > > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

