I am trying to create my first Android app and need some help.
Basically the app has a webview which loads a URL which works fine but I have a button under it that I want when pressed to open a different URL in the webview window.
I cannot figure out how to tell the button to do this.
This is my first app so apologise if the answer is very simple.
Many thanks in advance
Jay
Assuming the button is inside the webView…
create a new class which extends webviewclient and add this to your web view like this.. , it will load the remaining urls in the same web view.
take a look at this tutorial too….
if it is outside webView.. then
mWebView is the web view in your xml.you need to get access to it. Put the above code in
onCreateof your activity after you dosetContentView()