Yes that worked

I used:

timeLimitPreference = getPreferenceScreen().findPreference
("time_limit");

to get hold of the preference and then:

timeLimitPreference.setOnPreferenceChangeListener

to to validate the preference returning false if it was no successful
and thus canceling the change.

cheers


On Dec 13, 3:52 pm, "Mark Murphy" <[email protected]> wrote:
> > I have an XML file called user_preferences that contains my
> > preferences for my application.
>
> > How do I get hold of the differentpreferenceViews so that I can
> > validate them?
>
> > Currently I have the code below which is not working because
> > getSharedPreferences does not return a View.
>
> You can try calling getPreferenceScreen(), though a better approach is to
> add more validation-style configuration to the preferences themselves. For
> example, EditTextPreference supports all of the XML attributes that
> EditText does for determining input type and such.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html

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