Well, in that case you already know the widget id for a particular instance of your configuration activity - it's passed in as an intent extra. 25.04.2011 1:21 пользователь "Jake Colman" <[email protected]> написал: >>>>>> "KV" == Kostya Vasilyev <[email protected]> writes: > > KV> 24.04.2011 19:35, Jake Colman пишет: > > >> If I use an onClickListener() and on > >> SharedPreferenceChangeListener() to detect specific preference > >> clicks or changes to a preference, I can parse out the widget ID > >> from the key so that I know which specific widget has been > >> effected. I can then make sure that I update just that specific > >> widget accordingly. Can you think of a better way to do that? > > KV> Umm... Sounds like you also want to present options for multiple > KV> widgets at the same time within a single preference activity? > > KV> If so, I would not use the activity as the event listener. > > KV> I'd create a class that encapsulates the complete set of > KV> preferences for one widget instance, serves as the event listener > KV> for the involved Preference objects, and knows its associated > KV> widget Id value. The activity would instantiate these objects as > KV> needed, one for each widget Id. > > KV> I'd also use onPreferenceChange rather that > KV> onSharedPreferenceChanged, because the former uses a Preference > KV> reference you can switch on, without parsing preference keys. > > Actually, no. :-) > > I want to, for example, allow instance #1 to have a different label than > instance #2. If I continue to use my single Preference Activity which > has one listener for all widgets, it will need to know which widget's > key has been changed so that it can update that instance. Hmmmmm. > Unless I just update all instances all the time when any one instance's > preference is changed... > > > -- > Jake Colman -- Android Tinkerer > > -- > 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
-- 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

