TabHost.setCurrentTab(index) work for first time
<p>I created TabActivity having two tabs with two activities.
one is login tab another is welcome tab.</p>

<p>user should not go welcome tab unless login successfully.if he tries to select welcome tab he throws to login tab.i use tabHost.setcurrenttab(index).</p>

<p>But when i click direct welcome tab it works fine for first time. When i again click tab rapidly it opens welcome tab.</p>

<p>Here is my code:</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.product_list);
            SharedPreferences mPreference = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            username = mPreference.getBoolean("valid", false);
            Toast.makeText(this, "In Create", Toast.LENGTH_SHORT).show();
           //login sucessful            
           tabActivity.switchTab(0);
     }
</code></pre>

<p>on onResume, i repeat the same code.</p>
