Discover when the user closes the preferences activity
<p>I know it may sound silly, but I really cannot understand if there is a straightforward and standard way to understand when a user gets out from the preferences activity.</p>

<pre><code>case R.id.menu_settings:
        Intent i = new Intent(this, Pref.class); startActivity(i);
        Toast.makeText(this, "test", Toast.LENGTH_SHORT).show();
        updateData();
        return true;
</code></pre>

<p>Obviously here the "test" Toast appears asynchronously, while the preferences window is still open. But in the preferences the user could change vital parameters that, to be applied, need updateData() to be called: how can I do? I'm sure that there's a obvious way to do it, but I'm missing it....
Thank you.</p>
