TabActivity pass extras to child intents
<p>I have three activities:</p>

<p><strong>Activity A</strong> - Displays a list of data from a website.  From this activity you can perform an action which would add something to this list (Activity B).</p>

<p><strong>Activity B</strong> - This is the activity that adds data to the website.  Upon successful completion this activity will need to tell Activity A to refresh its list.</p>

<p><strong>Activity T</strong> - A TabHost which contains Activity A.</p>

<p>My problem is:</p>

<p>Activity B needs to tell Activity A to refresh, but its intent must be Activity T, since I want the TabHost to display Activity A.</p>

<pre><code>//ActivityB.class
Intent myIntent = new Intent(v.getContext(), ActivityT.class);
myIntent.putExtra("target", "ActivityA");
myIntent.putExtra("refreshData", true);
startActivityForResult(myIntent, 0);
</code></pre>

<p>I thought I could use the TabHost as an intermediary and just pass the extras through to Activity A if they were set, like so:</p>

<pre><code>//ActivityT.class
Bundle extras = getIntent().getExtras();

// Create an Intent to launch an Activity for the tab (to be reused)
intent = new Intent().setClass(this, ActivityA.class);

// Check to see if we want to pass our bundle through to the activity
if (extras != null &amp;&amp; extras.getString("target").equals("activityA")) {
     intent.putExtras(extras);
}

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("Tab1").setIndicator("Tab1",
            res.getDrawable(R.drawable.ic_tab_tab1)).setContent(intent);
tabHost.addTab(spec);
</code></pre>

<p>This works great, except that when I change tabs to a different tab and change back, the extras are passed through yet again, and again - which causes my tab to refresh its data every time, even though I'm no longer coming from Activity B.  This is because the TabActivity doesn't get recreated on tab change and therefore the extras are always passed through to the child intents.</p>

<p>So, how I can tell Activity A to refresh ONLY from Activity B, but still get the TabHost to show up?</p>
