📜  java 到 kotlin - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:13.099000             🧑  作者: Mango

代码示例2
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.web_view_foto_activity);
        webView = (WebView) findViewById(R.id.webViewfoto);
        webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setLoadWithOverviewMode(true);
        webSettings.setAllowFileAccess(true);
        webView.setWebViewClient(new Client());
        webView.setWebChromeClient(new ChromeClient());
        if (Build.VERSION.SDK_INT >= 30) {
            webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        }
        else if(Build.VERSION.SDK_INT >=11 && Build.VERSION.SDK_INT < 30) {
            webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        }
        webView.loadUrl("https://sportfischerverein-onstmettingen.jagen-fuer-jaeger.de/sfv-onstmettingen/fangmeldung"); //change with your website
    }