How come the preferences activity is launched when selecting my app from the menu displayed when pressing the Home button?
<p>Steps:</p>

<ol>
<li>I start my Android app.</li>
<li>I press the Menu button and select Preferences => preferences screen appears.</li>
<li>I make a preference and then press the Back button => the application's main activity appears again.</li>
<li>I press the Back buttton => Home screen.</li>
<li>I press the Home button and select my app => Preferences screen appears...why??</li>
</ol>

<p>Main activity</p>

<pre><code>@Override
protected void onResume()
{
   startService();
   super.onResume();
}

private void startService() 
{
   ...
   preferences = PreferenceManager.getDefaultSharedPreferences(this);   
   startService(new Intent(MainActivity.this, WeatherService.class));
   ...
}

@Override
protected void onPause()
{
   unbindService();
   super.onPause();
}


private void onPreferences() 
{
   Intent i = new Intent(MainActivity.this, Preferences.class);
   startActivity(i);
}
</code></pre>

<p>Preference activity</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) 
{
   super.onCreate(savedInstanceState);

   addPreferencesFromResource(R.xml.preferences);
}
</code></pre>

<p>Cheers,
Christian</p>
