I have researched a lot that how can I align the tabs at the bottom of page using this code but I didn't find any content, I am using the code as:
public class MainActivity extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1")
.setIndicator("Home")
.setContent(new Intent(this, TabGroup1Activity.class)));
tabHost.addTab(tabHost.newTabSpec("tab2")
.setIndicator("Search"/*, getResources().getDrawable(R.drawable.ic_launcher)*/)
.setContent(new Intent(this, TabGroup2Activity.class))
);
tabHost.addTab(tabHost.newTabSpec("tab3")
.setIndicator("About Us")
.setContent(new Intent(this, TabGroup3Activity.class)));
tabHost.getTabWidget().setCurrentTab(0);
tabHost.getTabWidget().setGravity(Gravity.BOTTOM);
And the TabGroup1Activity is:
public class TabGroup1Activity extends TabGroupActivity{
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startChildActivity("HomeActivity", new Intent(this,HomeActivity.class));
}
}
By using this code, the tab bar is coming at the top of the screen but I want to place it at the bottom ..Please suggest something and I found this method is quite easy for creating tabs