Get to default shared preferences without invoking PreferenceActivity
<p>I have the following PreferenceActivity defined:</p>

<pre><code>public class HiddenPreferences extends PreferenceActivity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.hidden_prefs);
    }
}
</code></pre>

<p>where the hidden_prefs.xml looks something like this:</p>

<pre><code>&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;EditTextPreference android:key="testRestUrl"
        android:title="REST service URI"
        android:defaultValue="http://service/url"&gt;
    &lt;/EditTextPreference&gt;

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

<p>now I set the values to default and would like to read this preference in some other activity, like this:</p>

<pre><code>PreferenceManager.setDefaultValues(this, R.xml.hidden_prefs, false);        
prefs = PreferenceManager.getDefaultSharedPreferences(this);
</code></pre>

<p>but when calling:</p>

<pre><code>prefs.getString("testRestUrl", "");
</code></pre>

<p>I need to give the default value as second parameter, and the call always returns "" (as given in the call) but not the default value as given in the XML android:defaultValue attribute. </p>

<p>How should the preference be access in order to get the default value?</p>
