Answer the question
In order to leave comments, you need to log in
How to open links in a webview application correctly?
There is a webview application that pulls up a specific url. But other links from this site open here, tell me how to open other links in a regular browser, not in the application.
MainActivity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView = (WebView) findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("http://example.com");
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question