Android TabHost makes View.INVISIBLE useless
<p>I have 4 tabs in my application. At first, I would like to hide all the component in my first tab, tab1. When I first enter the apps, the components really hide. But the strange things happen here, if I then clicks the tab2 and then go to tab2, that's fine. After that, I click back to tab1, this time, all component in my tab1 appears again. Please help to point out the problems. Here is my code:  </p>

<pre><code>public class abc extends TabActivity {

    TabHost tabHost;    

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

        tabHost = getTabHost();
        LayoutInflater.from(this).inflate(R.layout.main,
                tabHost.getTabContentView(), true);
        tabHost.addTab(tabHost.newTabSpec("tab1")
                .setIndicator("",getResources().getDrawable(R.drawable.search))
                .setContent(R.id.tab1)); 

        tabHost.addTab(tabHost.newTabSpec("tab2")
                .setIndicator("",getResources().getDrawable(R.drawable.hotitem))
                .setContent(new Intent(this, tab2.class))); 

        tabHost.addTab(tabHost.newTabSpec("tab3")
                .setIndicator("",getResources().getDrawable(R.drawable.reminder))
                .setContent(new Intent(this, tab3.class)));

        tabHost.addTab(tabHost.newTabSpec("tab4")
                .setIndicator("",getResources().getDrawable(R.drawable.compass))
                .setContent(new Intent(this, tab4.class)));

        if(Variable.isLogin == 0){
            tab1 = (LinearLayout)findViewById(R.id.tab1);
            tab1.setVisibility(View.INVISIBLE);
        }
    }

    @Override
    public void onResume(){
        super.onResume();
        Log.d("log_tag", "onResume");
        if(Variable.isLogin == 0){
            tab1.setVisibility(View.INVISIBLE);
        }
    }
    @Override
    public void onPause(){
        super.onPause();
        Log.d("log_tag", "onPause");
    }
    @Override
    public void onStop(){
        super.onStop();
        Log.d("log_tag", "Stop");
    }
    @Override
    public void onRestart(){
        super.onRestart();
        Log.d("log_tag", "onRestart");
    }
    @Override
    public void onStart(){
        super.onStart();
        Log.d("log_tag", "onStart");
    }
}
</code></pre>
