android OnBackPressed not firing when the activity is resumed
<p>I have a Tab Activity and 5 child activities. <br/> The Tab Activity is the launcher activtiy.</p>

<p>When Activity 1 is started using <code>tabHost.setCurrentTabByTag(CommonParams.HOME_TAG);</code>,  the phone's back-button-press,  fires the OnBackPressed of Actvitiy 1.</p>

<p>But when i start Activity 1 and then navigate to Activity 2 by clicking on the 2nd Tab, and then come back to Activity 1 by clicking on 1st tab, then the phone's back-button-press does not fire the OnBackPressed(). It makes the app to exit.</p>

<p>I load the activities on tab press by the following code.</p>

<pre><code>        intent = new Intent().setClass(this, Activity1.class);
        spec = tabHost
                .newTabSpec(CommonParams.HOME_TAG)
                .setIndicator("Home",
                        res.getDrawable(R.drawable.ic_tab_home))
                .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(this, Activity2.class);
        spec = tabHost
                .newTabSpec(CommonParams.PAGE2_TAG)
                .setIndicator("Page2",
                        res.getDrawable(R.drawable.ic_tab_page2))
                .setContent(intent);
        tabHost.addTab(spec);
</code></pre>

<p>So when navigate from Home to Page2 and then back to Home using the tabs, Activity 1 is not started fresh. It is resumed. I suppose, OnBackPressed() is not getting fired on resumed activites.</p>

<p>Is it something like the activity lost its focus? If so how to avoid the activity losing focus, or how to give focus to the activity OnResume()?</p>

<p>Could someone help me to find why the OnBackPressed is not firing and how to make it work.</p>

<p>Thanks in Advance</p>
