package stein.fbg.hsbo.de.jswebviewapp;


import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;


/**
 * A simple {@link Fragment} subclass.
 */
public class WebViewFragment extends Fragment {

    private static String URL = "https://developers.arcgis.com/javascript/beta/sample-code/satellites-3d/live/index.html";

    public WebViewFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_web_view, container, false);
        WebView webView = (WebView) view.findViewById(R.id.webview);
        webView.setWebViewClient(new WebViewClient());
        webView.addJavascriptInterface(new WebAppInterface(this.getContext()), "Android");
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setSupportZoom(true);
        //webView.loadUrl(URL);
        //webView.loadUrl("file:///android_asset/test.html");
        webView.loadUrl("file:///android_asset/esri.html");

        //String html = readHtml("esri.html");
        //webView.loadDataWithBaseURL("file:///android_asset/", html, "text/html", "UTF-8", null);
        return view;
    }

    private String readHtml(String fileName) {
        AssetManager am = getContext().getAssets();
        String out = "";
        BufferedReader in = null;
        try {
            InputStream is = am.open(fileName);
            InputStreamReader isr = new InputStreamReader(is);
            in = new BufferedReader(isr);
            String str;
            while ((str = in.readLine()) != null) {
                out += str;
            }
        } catch (MalformedURLException e) {

        } catch (IOException e) {
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return out;
    }



}

@@ -374,61 +374,8 @@
 er;%0A
-import java.io.File;%0Aimport java.io.FileInputStream;%0A
 impo
@@ -390,32 +390,32 @@
 io.IOException;%0A
+
 import java.io.I
@@ -503,29 +503,8 @@
 on;%0A
-import java.net.URL;%0A
 %0A%0A/*
@@ -548,16 +548,16 @@
 ss.%0A */%0A
+
 public c
@@ -601,132 +601,8 @@
  %7B%0A%0A
-    private static String URL = %22https://developers.arcgis.com/javascript/beta/sample-code/satellites-3d/live/index.html%22;%0A%0A
     

Reformat code