title: cant pass value or webview unable to load
body: <p>i have passed value ID with a string to <code>Browser_activity.java</code> from <code>About_activity.java</code>which will direct the webview to a html file stored in assets. but when i clicked on the button it is routing to another activity but the webview is blank. i am not sure about the passing values from an activity to another but just copied from various sources.</p>
  
  <pre><code>package mavilla.paavaiinstitutions;
  
      import android.app.Activity;
      import android.content.Intent;
      import android.support.v7.app.ActionBarActivity;
      import android.os.Bundle;
      import android.view.Menu;
      import android.view.MenuItem;
      import android.view.View;
      import android.webkit.WebSettings;
      import android.webkit.WebView;
      import android.widget.Button;
      import android.widget.LinearLayout;
      import android.widget.Toast;
  
      import mavilla.paavaiinstitutions.Browser_activity;
  
  
      public class About_activity extends Activity implements View.OnClickListener {
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.about_activity);
  
  
  
  
  
              Button button1, button2, button3,button4,button5,button6,button7,button8,button9;
              button1 = (Button) findViewById(R.id.about);
              button2 = (Button) findViewById(R.id.history);
              button3 = (Button) findViewById(R.id.ideals);
              button4 = (Button) findViewById(R.id.objectives);
              button5 = (Button) findViewById(R.id.vision);
              button6 = (Button) findViewById(R.id.quality);
              button7 = (Button) findViewById(R.id.chairman);
              button8 = (Button) findViewById(R.id.trust);
              button9 = (Button) findViewById(R.id.management);
  
  
              button1.setOnClickListener(this);
              button2.setOnClickListener(this);
              button3.setOnClickListener(this);
              button4.setOnClickListener(this);
              button5.setOnClickListener(this);
              button6.setOnClickListener(this);
              button7.setOnClickListener(this);
              button8.setOnClickListener(this);
              button9.setOnClickListener(this);
  
          }
  
  
          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
              // Inflate the menu; this adds items to the action bar if it is present.
              getMenuInflater().inflate(R.menu.menu_about_activity, menu);
              return true;
          }
  
  
              @Override
              public void onClick(View v) {
  
                  switch(v.getId()) {
                      case R.id.about:
                          // do stuff;
  
                          Intent a = new Intent(About_activity.this, Browser_activity.class);
                          a.putExtra("ID", "about");
                          startActivity(a);
  
                          break;
                      case R.id.history:
                          // do stuff;
                          Intent b = new Intent(About_activity.this, Browser_activity.class);
                          b.putExtra("ID", "history");
                          startActivity(b);
  
  
                          break;
                      case R.id.objectives:
                          // do stuff;
                          Intent c = new Intent(About_activity.this, Browser_activity.class);
                          c.putExtra("ID", "objectives");
                          startActivity(c);
  
  
                          break;
                      case R.id.ideals:
                          // do stuff;
                          Intent d = new Intent(About_activity.this, Browser_activity.class);
                          d.putExtra("ID", "ideals");
                          startActivity(d);
  
  
                          break;
                      case R.id.vision:
                          // do stuff;
                          Intent e = new Intent(About_activity.this, Browser_activity.class);
                          e.putExtra("ID", "vision");
                          startActivity(e);
  
  
                          break;
                      case R.id.quality:
                          Intent f = new Intent(About_activity.this, Browser_activity.class);
                          f.putExtra("ID", "quality");
                          startActivity(f);
  
  
                          break;
                      case R.id.chairman:
                          // do stuff;
                          Intent g = new Intent(About_activity.this, Browser_activity.class);
                          g.putExtra("ID", "chairman");
                          startActivity(g);
  
  
                          break;
                      case R.id.trust:
                          // do stuff;
                          Intent h = new Intent(About_activity.this, Browser_activity.class);
                          h.putExtra("ID", "trust");
                          startActivity(h);
  
  
                          break;
                      case R.id.management:
                          // do stuff;
                          Intent i = new Intent(About_activity.this, Browser_activity.class);
                          i.putExtra("ID", "management");
                          startActivity(i);
  
  
                          break;
  
                  }
              }
  
  
          @Override
          public boolean onOptionsItemSelected(MenuItem item) {
              // Handle action bar item clicks here. The action bar will
              // automatically handle clicks on the Home/Up button, so long
              // as you specify a parent activity in AndroidManifest.xml.
              int id = item.getItemId();
  
              //noinspection SimplifiableIfStatement
              if (id == R.id.action_settings) {
                  return true;
              }
  
              return super.onOptionsItemSelected(item);
          }
      }
  </code></pre>
  
  <p>Browser_activity.java</p>
  
  <pre><code>package mavilla.paavaiinstitutions;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.Window;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  
  
  
  public class Browser_activity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.browser_activity);
          WebView myWebView = (WebView) findViewById(R.id.webView);
          WebSettings webSettings = myWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
  
  
  
          Intent intent = getIntent();
          String string1 = getIntent().getStringExtra("ID");
  
  
          if(string1=="about"){
              myWebView.loadUrl("file:///android_asset/about.html");
  
          }
          if(string1=="history"){
              myWebView.loadUrl("file:///android_asset/history.html");
  
          }
          if(string1=="objectives"){
              myWebView.loadUrl("file:///android_asset/objectives.html");
  
          }
          if(string1=="ideals"){
              myWebView.loadUrl("file:///android_asset/ideals.html");
  
          }
          if(string1=="vision"){
              myWebView.loadUrl("file:///android_asset/vision.html");
  
          }
          if(string1=="quality"){
              myWebView.loadUrl("file:///android_asset/quality.html");
  
          }
          if(string1=="chairman"){
              myWebView.loadUrl("file:///android_asset/chairman.html");
  
          }
          if(string1=="trust"){
              myWebView.loadUrl("file:///android_asset/trust.html");
  
          }
          if(string1=="management"){
              myWebView.loadUrl("file:///android_asset/management.html");
  
          }
  
  
  
  
  
  
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_browser_activity, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>