sharedpreferences that don't change from activity to activity?
<p>If i set a sharedpreference in one activity, why does the other one has different preferences? context changed? (but i se use application context!)</p>

<p>Here is my code</p>

<pre><code>MyApp appState = ((MyApp)this.activity.getApplicationContext());
appState.setDittaSelezionata( (int) itemId);
</code></pre>

<p>....</p>

<pre><code>MyApp appState = ((MyApp)this.getApplicationContext());
int ditta_id_selezionata = appState.getIdSomething();
</code></pre>

<p>And</p>

<pre><code>public class MyApp extends Application implements Parcelable {

    private SharedPreferences getSharedPrefs()
    {
    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
    //SharedPreferences settings = this.getSharedPreferences(MyApp.PREFS_NAME, this.MODE_PRIVATE);
    return settings;
}
public int getIdSomething() {
    SharedPreferences settings = this.getSharedPrefs();
    return settings.getInt("ditta_id_selezionata", 0);
}

public void setDittaSelezionata(final int ditta_selezionata) {

    SharedPreferences settings = this.getSharedPrefs();
    SharedPreferences.Editor editor = settings.edit();
    editor.putInt("ditta_id_selezionata",  ditta_selezionata);

    // Commit the edits!
    editor.commit();
}
</code></pre>

<p>...</p>

<p>How can i make global preferences that are shared among all activities android 3.2? is there something android provides or i have to code a save to file/open to file and add it for each activity onStop() / onCreate() ?</p>
