TabActivity在Android中不起作用?

TabActivity在Android中不起作用?,android,checkbox,tabactivity,Android,Checkbox,Tabactivity,我的选项卡活动中有3个选项卡。在第二个选项卡中,如果复选框被选中,则会出现一个复选框。如果复选框被选中,则表示启用第三个选项卡布局内容,否则将禁用布局内容。如何做到这一点,请帮助我。我尝试了一些是无效的 这是我的代码: 第二个选项卡。活动: resistent.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChan

我的选项卡活动中有3个选项卡。在第二个选项卡中,如果复选框被选中,则会出现一个复选框。如果复选框被选中,则表示启用第三个选项卡布局内容,否则将禁用布局内容。如何做到这一点,请帮助我。我尝试了一些是无效的

这是我的代码:

第二个选项卡。活动:

resistent.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
                // TODO Auto-generated method stub
                if(resistent.isChecked()==true)
                {
                    AuthenticationConstant.residentenable=true;//is boolean value
                }
                else
                {
                    AuthenticationConstant.residentenable=false;
                }

            }
        });
public void layoutfunction() {
        // TODO Auto-generated method stub

        if (AuthenticationConstant.residentenable) {
            rlayout.setVisibility(View.VISIBLE);

        } else {
            rlayout.setVisibility(View.INVISIBLE);
        }
第三个选项卡。活动:

resistent.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
                // TODO Auto-generated method stub
                if(resistent.isChecked()==true)
                {
                    AuthenticationConstant.residentenable=true;//is boolean value
                }
                else
                {
                    AuthenticationConstant.residentenable=false;
                }

            }
        });
public void layoutfunction() {
        // TODO Auto-generated method stub

        if (AuthenticationConstant.residentenable) {
            rlayout.setVisibility(View.VISIBLE);

        } else {
            rlayout.setVisibility(View.INVISIBLE);
        }