I use tabhost in my app.
I use below code to add intent:
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
Resources res = getResources();
intent = new Intent().setClass(this, AActivity.class);
spec = tabHost.newTabSpec("Files").setIndicator("NAS Files", res.getDrawable(R.drawable.ic)).setContent(intent);
tabHost.addTab(spec);
In AActivity, I want to hide the tabs(TabWidget) while the button was clicked.
And click two times to show tabs.
How can I do it?
There are three states for view visibility in Android.
Below are how you do so programatically.
So, you can set an
OnClickListenerontabHostthat modifies the visibility of the view.To catch double taps, you can keep a counter of taps on the onClick and expire them after a time threshold.
See this question for more info on the double tap
Read the visibility api doc here