title: How do I load url from Bundle in Android
body: <p>I cannot load page using link that is passed from a previous Activity.</p>
  
  <p>The code is as follows</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_show_webpage);
  
      webView = (WebView) findViewById(R.id.webView);
      WebSettings webSettings = webView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      /*Bundle b = getIntent().getExtras();
      String url = b.getString(DeviceDetails.URL_KEY);*/
  
      String url = getIntent().getStringExtra(DeviceDetails.URL_KEY);
      //String url = "http://google.pl/nexus/4";
      webView.setWebViewClient(new MyWebViewClient());
      webView.loadUrl(url);
  }
  
  
  private class MyWebViewClient extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          view.loadUrl(url);
          return true;
      }
  }
  </code></pre>
  
  <p>So, when I use String url="http://google.pl/nexus/4" all seems to be fine. And I'm totally sure that my activity gets the url from <code>getIntent</code> because I debugged it.</p>
  
  <p><strong>UPD1:</strong></p>
  
  <pre><code>String inputUrl = detUrlEditText.getText().toString();
  Intent intent = new Intent(DeviceDetails.this, ShowWebPageActivity.class);
  Bundle extras = new Bundle();
  extras.putString(URL_KEY, inputUrl);
  intent.putExtras(extras);
  startActivity(intent);
  </code></pre>
  
  <p>Previous Activity. It is guaranteed to pass url because I debugged it. And toast also shows passed url in <code>ShowWebPageActivity</code>.</p>