Possible duplicate:
Android browser opens default browser
I have an application that launches a website in a web browser at startup, however I cannot figure out how to save the URL that the user clicked when opening in the browser.
Is there a way to load a clickable URL inside a webview application?
EDIT. Using the solution below, I still get the error message in the private class "Invalid modifier for the local MainScreenActivity class, only abstract or final allowed" ... even if I try to rename it, I get the same error
public class MainScreenActivity extends Activity {
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
WebView webview = new WebView(this);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://www.talk-of-the-tyne.co.uk");
setContentView(webview);
private class MainScreenActivity extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}
}
Sorry if I'm fat about it, I just can't seem to be fooling it.