Opening webview not in new browser

前端 未结 9 1765
走了就别回头了
走了就别回头了 2020-11-28 09:14

I am implementing a webview. I want two buttons on the top of the web page.

I have one vertical linear layout, inside of which is one horizontal layout with two but

9条回答
  •  爱一瞬间的悲伤
    2020-11-28 09:19

    I had the exact same problem and fortunately after browsing the web for about an hour I mixed some of the things I found and it worked.

    this is the code:

    WebView webView;
    webView = ((WebView) rootView.findViewById(R.id.detail_area));
    webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebViewClient(new WebViewClient());
    webView.loadUrl(mItem.link);
    

    where "detail_area" was my webview, rootView was my selected item inside a "Master/Detail Flow", link was the URL I wanted to open.

提交回复
热议问题