Answer the question
In order to leave comments, you need to log in
How to add javascript support to webview android studio?
package com.example.webnure;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.JavascriptInterface;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView webView = new WebView(this);
setContentView(webView);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://nure.ua/");
}
}
Answer the question
In order to leave comments, you need to log in
Found
webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true);
webSettings.setLoadWithOverviewMode(true); webSettings.setUseWideViewPort(true);
webSettings.setBuiltInZoomControls(true); webSettings.setDisplayZoomControls(false);
webSettings.setSupportZoom(true); webSettings.setDefaultTextEncodingName("utf-8");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question