title: How to add tabs dynamically that can be linked to a users choice of webpage
body: <p>I am developing an application that uses tabs with each tab being linked to a webpage that the user will be able to see and interact with using webview. what i am having trouble with is implementing a add command that the user will be able to use to  add a tab with a url of their choice that works just like the others</p>
  
  <p>Below is my code</p>
  
  <p>Here is the main java file that all other files use</p>
  
  <pre><code>public class UniversityofColorado extends TabActivity {
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      TabHost host=getTabHost();
  
      host.addTab(host.newTabSpec("one")
              .setIndicator("Google")
              .setContent(new Intent(this, Hello.class)));
  
      host.addTab(host.newTabSpec("two")
                      .setIndicator("Colorado Main Site")
                      .setContent(new Intent(this, ColoradoMainSiteBrowser.class)));
  
      host.addTab(host.newTabSpec("three")
                      .setIndicator("CULearn")
                      .setContent(new Intent(this, CULearnBrowser.class)));
  
      host.addTab(host.newTabSpec("four")
              .setIndicator("CULink")
              .setContent(new Intent(this, CULinkBrowser.class)));
  
      host.addTab(host.newTabSpec("five")
              .setIndicator("MyCUInfo")
              .setContent(new Intent(this, MyCUInfoBrowser.class)));
  
      host.addTab(host.newTabSpec("six")
              .setIndicator("Campus Map")
              .setContent(new Intent(this, CampusBrowser.class)));
  
      host.addTab(host.newTabSpec("Seven")
              .setIndicator("Notes")
              .setContent(new Intent(this, Notepadv3.class)));
  }   
  
  
  
  
      // Inflates menu when "menu Key" is pressed
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.menu, menu);
          return true;
      }
  }
  </code></pre>
  
  <p>Then i have each webpage defined in a seperate java file that the main file calls
  below is one of them</p>
  
  <pre><code>public class ColoradoMainSiteBrowser extends Activity {
  
  WebView webview;
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  webview = (WebView) findViewById(R.id.webview);
  webview.setWebViewClient(new HelloWebViewClient());
  webview.getSettings().setJavaScriptEnabled(true);
  webview.loadUrl("http://colorado.edu/");
  }
  private class HelloWebViewClient extends WebViewClient {
  @Override
  public boolean shouldOverrideUrlLoading(WebView view, String url)
  {
  view.loadUrl(url);
  return true;
  }
  }
  public boolean onKeyDown(int keyCode, KeyEvent event) {
  if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {
  webview.goBack();
  return true;
  }
  return super.onKeyDown(keyCode, event);
  }
  }
  </code></pre>
  
  <p>I have the menu defined in the main file i just need to construct the methods so the buttons do what they are suppose to do. any help would be great</p>