Hello.

Getting start with Android, I'm trying to create a "Game of life"
software. My application has a TableLayout filled with ImageView for
each cell. I'm trying to run/stop the game once a button has been
click (same button for both). Anyway, what I'm trying to do is to
change my GUI from the thread that run the game. I cannot change the
GUI from a new thread. Ok.

Then I'm trying to use the AsyncTask class to avoid this problem.
Using this mechanism, I still get a "android.view.ViewRoot
$CalledFromWrongThreadException: Only the original thread that created
a view hierarchy can touch its views" Exception.

I'm really stuck and lost with this, any help would be more than
welcome.

Here is the revelant code: http://fr.pastebin.ca/1597363
The Exception is raised in the method drawBoard when I try to set the
image of the ImageView.

Thanks.

I.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to