title: How do I pass dynamic URL to each Webview Activity in a multi-tab with 1 web view in each tab - Android App
body: <p>My Application is a news App. composed of 5 Tabs or More (this will be a setting based on each user's requirement).</p>
  
  <p>When the application Start I create the 5 Tabs dynamically and create a webview as an intent for each Tab, I just need to pass the URL for each tab to the intent here's my Code.</p>
  
  <p><strong>This is the main activity</strong></p>
  
  <pre><code>package news.mobile;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.app.TabActivity;
  import android.widget.TabWidget;
  import android.widget.TabHost;
  import android.widget.TabHost.TabSpec;
  import android.content.Intent;
  
  public class NewsMobile extends TabActivity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          TabHost tabHost = getTabHost();
          // Here I create the tabs dynamically.
          for(int i=0;i&lt;5;i++){
          tabHost.addTab(
                  tabHost.newTabSpec("tab"+i)
                  .setIndicator("Politics")
                      // I need to pass an argument to the WebviewActivity to open a
                      // specific URL assume it is "http://mysite.com/?category="+i
                  .setContent( new Intent(this, WebviewActivity.class)));
          }
          tabHost.setCurrentTab(0);
      }
  }
  </code></pre>
  
  <p><strong>This is my Webview Creator Activity</strong></p>
  
  <pre><code>package news.mobile;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.webkit.WebView;
  
  public class WebviewActivity extends Activity {
      WebView browse;
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          browse=new WebView(this);
          setContentView(browse);
                  // I need the following line to read an argument and add it to the url
          browse.loadUrl("http://mysite.com/?category=");
      }
  } 
  </code></pre>