setDefaultTab(someIndex) not working in android
<p>I am using TabActivity having 5 tabs in it i want to set 2nd tab as Default tab ,I am using this code in <code>onCreate</code> Method that </p>

<pre><code>    onCreate(){
    tabHost = getTabHost();  // The activity TabHost

    for(i=0;i&lt;=4;i++){
    Intent intent;
    if(i=0){
    intent = new Intent (this, A.class);
    }else
    if(i=1){
    intent = new Intent (this, B.class);
    }
    if(i=2){
    intent = new Intent (this, C.class);
    }else
    if(i=3){
    intent = new Intent (this, A.class);
    }else{
    intent = new Intent(this,D.class);
}
    spec =tabHost.newTabSpec(String(i)).setIndicator(linearLayout).setContent(intent);//linearLayout some view to be set to tab
    tabHost.addTab(spec);
    }
        setDefaultTab(2);
    }
</code></pre>

<p>I want to set 2nd position TAB default and want to open C Activity But above code is not worked 
But it doesnot works , also tried </p>

<pre><code>setCurrentTab(2);
</code></pre>

<p>It works fine but it is opening first default 0th tab and then opening 2nd tab but this should not be done
how to open default Tab as 2nd tab .</p>
