views:

24

answers:

2

I can't seem to use data that is in an EditText box.

I have one activity for entering a url and a submit button.

When the user clicks submit, a new activity opens as a WebView and should display the url that the user typed in the EditText box.

This should be the simplest of tasks but I can't find how to do it anywhere...

A: 

when you create the Intent to start the next activity, you will use Intent.putExtra(...) to bundle the url and set the action to VIEW.

see the examples here.

mtmurdock
That was it, thank you!
PetrakovichJ
A: 

You can write below code

  Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
  myIntent.putExtra("Url", edittext.getText());

And you can fetch this string in NextActivity using

  String url = this.getIntent().getExtras().getString("Url");
krunal shah
Thank you, that did it.
PetrakovichJ