tags:

views:

165

answers:

3

In android how to close TabWidget when a tab is selected.
As the title, I want close the TabWidget where some tab is selected.

A: 

Can you elaborate on what do you mean by "close" the tabwidget?

MasterGaurav
This means close the tabs row when a tab is selected.Just display the child activity.
imcaptor
Ah! Do you mean the row where tabs are shown so that you can select one or the other? That, AFAIK, cannot be closed.
MasterGaurav
A: 
//I use the OnTabChangeListener solve the question.
 mTabHost.setOnTabChangedListener(new OnTabChangeListener(){
        @Override
        public void onTabChanged(String tabId) {
            if (DEBUG) Log.d(TAG, "onTabChanged()");
            if("testTabId".equals(tabId)) {
                //destroy earth

                Intent intentTabMe = new Intent(MainActivity.this, UserDetailsActivity.class);
                intentTabMe.setAction(Intent.ACTION_VIEW);

                startActivity(intentTabMe);
            }                
        }
    });
imcaptor
A: 

What will I do when I want to close only the selected tab?????? Is there any function like remove tab????? Here only the current tab will be removed...... plz help......

Toufique