how to stop switching of tabs in android?
I my application am using four tabs . Each tab contains an acticity. So one of tab contains downloa Activity where i use to download some content from web. I have a case where i need stop switching of tabs , when download process is going on.
i.e; In download tab , when download is going on , it should'nt switch ta开发者_开发知识库b.
Can any one gimme an idea about it. Regards, Srinivas
Just override onTouch() of tabHost
int numberOfTabs = tabHost.getTabWidget().getChildCount();
for (int t = 0; t < numberOfTabs; t++)
{
tabHost.getTabWidget().getChildAt(t).setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
return true;
});
}
精彩评论