Hi!

The API (http://developer.android.com/reference/android/content/
SharedPreferences.OnSharedPreferenceChangeListener.html) states that
onSharedPreferenceChanged is run on "your main thread". With this
believe I implemented a activity which is registered as a
SharedPreferenceListener within onStart and unregistered in onStop.
When a broadcast receiver changes the sharedPreference of interest I
receive an exception
"android.view.ViewRoot$CalledFromWrongThreadException: Only the
original thread that created a view hierarchy can touch its views."

Why is this? I'm aware of the fact to use handlers for this kind of
problem but is the API wrong or do I misinterpret the writing "your
main thread" ? I read it as: "Since it's on the main thread you don't
have to worry..."

best reagards,
Gerhard

-- 
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