Answers for "can you show html page inside app on webview android studio"

12

webview in android studio

private WebView webView;


    @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("https://www.javatpoint.com/java-tutorial");

        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);

    }
    @Override
    public void onBackPressed() {
        if (webView.canGoBack()) {
            webView.goBack();
        } else {
            super.onBackPressed();
        }
    }
Posted by: Guest on June-07-2020

Code answers related to "can you show html page inside app on webview android studio"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language