Only one activity with one view is active at any time. If you want to
update the score in real time from both the logic view and the game
view, the only way to do that is to put both in one activity and one
view. Otherwise, afaik the view in the background would only update
soon as it becomes the active view, in which case you could share the
data through sharedPreferences or a database.

If you really want to have two views in two activities that can share
data in real time, you can create a service that is bound by both
activities and that has callbacks to both activities.  But again, I
don't see the point in doing so.


On Aug 1, 11:02 pm, Illidane <[email protected]> wrote:
> Hi!
> I'm writing some game using OpenGL and have two views : SurfaceView
> for OGL and TextView for my score. When I try to update score ( using
> BoardScore.setText("bla"); ) from my activity class all just fine, but
> when I try to do it from my logic class my app crash. Debugger says
> something like ViewRoot$CalledFromWrongThreadException
> (id=830053983760)
> But I need to update it from logic to know my score.
> Do you know something about this issue?
>
> Thanks for help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to