Android Prefererences
<p>I'm coming to think my problem is with my preferences not being done correctly is why i cannot access tem. Here is My preferences:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;

    &lt;PreferenceCategory 
        android:title="@string/pref_user_profile" 
        android:textSize="20px"
        android:layout="@layout/pref_layout"&gt;

        &lt;SwitchPreference 
                android:title="@+string/pref_frequency"
                android:summary="@+string/pref_frequency_summary"
                android:key="frequency" 
                android:defaultValue="true"
            android:layout="@layout/pref_layout"/&gt;

        &lt;SwitchPreference 
                android:title="@+string/pref_time"
                android:summary="@+string/pref_time_summary"
                android:key="time"
                android:defaultValue="true"
            android:layout="@layout/pref_layout"/&gt;

        &lt;SwitchPreference  
                android:title="@+string/pref_symptothermal"
                android:summary="@+string/pref_symptothermal_summary"
                android:key="symptothermal"
                android:defaultValue="true"
                android:layout="@layout/pref_layout"/&gt;

        &lt;SwitchPreference 
                android:title="@+string/pref_cervical_mucus"
                android:summary="@+string/pref_cervical_mucus_summary"
                android:key="cervical_mucus"
                android:defaultValue="true"
            android:layout="@layout/pref_layout"/&gt;    

        &lt;SwitchPreference 
                android:title="@+string/pref_mucus_stamps"
                android:summary="@+string/pref_mucus_stamps_summary"
                android:key="mucus_stamps"
                android:defaultValue="true"
            android:layout="@layout/pref_layout"/&gt;

        &lt;SwitchPreference 
                android:title="@+string/pref_fertile_infertile"
                android:summary="@+string/pref_fertile_infertile_summary"
                android:key="fertile_infertil" 
                android:defaultValue="true"
            android:layout="@layout/pref_layout"/&gt;
    &lt;/PreferenceCategory&gt;

&lt;/PreferenceScreen&gt;
</code></pre>

<p>Java:</p>

<pre><code>package com.projectcaruso.naturalfamilyplaning;

import com.projectcaruso.naturalfamilyplanning.R;
import android.os.Bundle;
import android.preference.PreferenceActivity;

public class UserSettingActivity extends PreferenceActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        addPreferencesFromResource(R.xml.settings);

    }
}
</code></pre>

<p>Here is my call to the settings menu:</p>

<pre><code>@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        final int RESULT_SETTINGS = 1;

        switch (item.getItemId()) {
        case R.id.projectcaruso:
            Util.goToGitHub(this);
            return true;
        case R.id.about:
            new AlertDialog.Builder(this)
            .setTitle(R.string.about)
            .setMessage(Html.fromHtml(getString(R.string.about_msg)))
            .show();
            break;
        case R.id.licenses:
            new AlertDialog.Builder(this)
            .setTitle(R.string.licenses)
            .setMessage(Html.fromHtml(getString(R.string.license_detail)))
            .show();
            break;
        case R.id.contact:
            break;
        case R.id.settings:
            Intent j = new Intent(this, UserSettingActivity.class);
            startActivityForResult(j, RESULT_SETTINGS);
            break;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getSupportMenuInflater().inflate(R.menu.settings, menu);
        return true;
    }

}
</code></pre>

<p>So any help would be appreciated! I'm trying to access these preferences but cannot. It seems to be saving them just fine. I am able to test and run the code, change the pref's and it saves their state. However when i try to access them i cannot... Here's the code i used to try and access them:</p>

<p>EDIT:
I've changed it to call as the following and no matter the setting it is still the "Hello toast 2!"
            @Override
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                SharedPreferences preferences = this.getActivity().getSharedPreferences("UserSettingActivity",0);
                // Inflate the layout for this fragment      </p>

<pre><code>            Boolean symptothermal = preferences.getBoolean("symptothermal", true);

            if (!symptothermal) {
                Context context = getActivity().getApplicationContext();
                Toast.makeText(context, "Hello toast 1!", Toast.LENGTH_LONG).show();
            } else {
                Context context = getActivity().getApplicationContext();
                Toast.makeText(context, "Hello toast 2!", Toast.LENGTH_LONG).show();
            }

            if (!symptothermal) {
                TextView temp = (TextView) getView().findViewById(R.id.temp);
                temp.setVisibility(View.GONE);
            }
        }
</code></pre>
