SharedPreferences preferences = this.getSharedPreferences
(PREFERENCE_FILE_NAME, MODE_PRIVATE);

where  PREFERENCE_FILE_NAME = package_name_preferences without the xml
extension.(default)
You can find the file by running " adb shell"

1. cd  /data/data/your_application_package/shared_prefs

Hope this helps,
Chander

On Jan 20, 7:24 am, "Ivan Soto" <ivanso...@gmail.com> wrote:
> Hi, I'm having a hard time trying to understand how the preferences activity
> works.
> Right now I have an activity for my preferences using a XML layout that has
> this:
>
> ....
>
>         <CheckBoxPreference
>
>                 android:key="checkbox_preference"
>
>                 android:title="Use light skin"
>
>                 android:summary="Use a white interface instead of the
> default one." />
>
> ....
>
> The thing is that everything I do in the preferences are saved. I can reboot
> the emulator and I can access the preferences. I want to know how can I
> access this key from another activity on my application.
>
> this is my activity:
>
> public class Config extends PreferenceActivity
> implementsOnSharedPreferenceChangeListener{
>
> �...@override
>
> protected void onCreate(Bundle savedInstanceState) {
>
> super.onCreate(savedInstanceState);
>
> addPreferencesFromResource(R.layout.config);
>
>  }
>
>  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
> String key) {
>
> // Nothing here.
>
> }
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to