Question

I'm using PreferenceActivity to set some preferences about another BroadcastReciever that i have.

While making the skeleton of the preferences GUI is really simple with XML file, i cant find my hands and legs around how to actually DO something with those preferences. especially:

  1. How do i register my BroadcastReciever to listen to changes in my preferences? Its look like that the context of the broadcast reciever is not the same as the activity so i'm not registering to the right SharedPreferences because i dont intercept those changes.

  2. How do i act in my PreferenceActivity upon changes in the preferences? i guess i dont need to register PreferenceActivity as listener to the preferences, so there must be more simple way.

  3. How do i change the UI of the PreferenceActivity appropriate to the changes in the preferences? for example, set the "Summary" attribute of a preference to the value that the user chose?

  4. How do i enable or disable some preferences that depends on another preference (like CheckBoxPreference)? so the user could edit those preferences only if he enabled the feature first.

I looked al over the documentation but there is no example of using PreferenceActivity beyond the point of just adding preferences from XML.

I feel like i'm missing something huge here, because it looks so simple, and yet i can't figure it out...

Please try to answer on any of my question.

BTW: I'm developing for Android 1.6 so all the new PreferenceFragment can't be used.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top