views:

56

answers:

1

Hi,

Is there any simple way to close the current tab or single tab in androids? I don't want to do clearing all tabs and adding the required tabs?

Please suggest me. Thanks in advance.

With regards Kavya

A: 

I have had the same problem, but I did not solved it with closing tabs. My solution was: set tab's visibility to View.GONE and tab will be invisible.

    TabHost tabs=getTabHost();
    tabs.getCurrentTabView().setVisibility(View.GONE);
Sergey Glotov
Even I did the same atlast :) Thanks.
I have one more problem. I want to put button on each tabs. Is it possible?
You mean put button on the TabWidget's buttons (tab button)?
Sergey Glotov
yes. is it possible?
I think it's possible, but it will be a little hard. You need rewrite TabWidget source code or extend TabWidget.
Sergey Glotov
I didn't get u. can u please explain me in detail?
TabWidget's button can contain only text label and image. But you can take source code of TabWidget and change it according to your needs. Why do you want this?
Sergey Glotov
for closing of tabs :) means same like a tabs of browser i wanted to implement. a button on each tab,and a listener to that button to close the tab after clicking it.