I am trying to get Web View current URL in dialog box.
I used following code, but its giving error
String webUrl1 = web.getUrl();
builder.setMessage(webUrl1);
here is full code.
i am trying to match url in if condition. but it doesn't giving any error nor working properly.
//setting up web view
setContentView(R.layout.main);
web = (WebView) findViewById(R.id.webView1);
setUpWebView();
web.loadUrl("http://www.example.com");
String webUrl1 = web.getUrl();
if (webUrl1=="http://www.example.com"){
//do something.
}