Skip to content

Instantly share code, notes, and snippets.

@nitindhar7
Created January 31, 2012 03:31
Show Gist options
  • Save nitindhar7/1708580 to your computer and use it in GitHub Desktop.
Save nitindhar7/1708580 to your computer and use it in GitHub Desktop.
Fragment - adding another tab (repeatitive)
// Add another tab
tab = inflater.inflate(R.layout.tab, getTabWidget(), false);
tab.setLayoutParams(params);
label = (TextView) tab.findViewById(R.id.tabLabel);
label.setText("USERS");
intent = new Intent(TabTutorialActivity.this, TabContentActivity.class);
intent.putExtra("content", "Content for USERS");
spec = tabHost.newTabSpec("users").setIndicator(tab).setContent(intent);
tabHost.addTab(spec);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment