A Bunch of questions regarding Android PreferenceActivity
-
30-10-2019 - |
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:
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 rightSharedPreferences
because i dont intercept those changes.How do i act in my
PreferenceActivity
upon changes in the preferences? i guess i dont need to registerPreferenceActivity
as listener to the preferences, so there must be more simple way.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?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