Ya, I originally updating the values in onSensorChanged() was not
working, but I did manage to get this to work in the end.  Thanks very
much for your response.

On Apr 10, 10:04 am, "[email protected]"
<[email protected]> wrote:
> Hi
>
> You can only modify views from the UI thread - as per the docs:
>
> "Note: The entire view tree is single threaded. You must always be on
> the UI thread when calling any method on any view. If you are doing
> work on other threads and want to update the state of a view from that
> thread, you should use a Handler."
>
> So, you could do that, i.e. in your timer thread post a message to a
> handler in your UI thread informing it to fetch the latest orientation
> values
>
> But I think a simpler approach is to avoid threading altogether - just
> implement onSensorChanged in your UI thread. It will be called
> whenever the orientation changes, avoiding the need for you to run a
> seperate thread to cache the values.
--~--~---------~--~----~------------~-------~--~----~
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