app/src/main/java/com/example/brom/webviewapp/MainActivity.java
// Create a private member variable that can hold our WebView
Create a private member variable that can hold our WebView
Create a private member variable that can hold our WebView
@Override
    protected void onCreate(Bundle savedInstanceState) {
        /* This code is run when the App is created. Include code that creates your WebView */
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        /*
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        }); */
        WebView webView = (WebView) findViewById(R.id.oscar);
        WebViewClient minapp = new WebViewClient();
        webView.setWebViewClient(minapp);
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.loadUrl("file:///android_asset/about.html");
    }
@ Override protected void onCreate ( Bundle savedInstanceState ) { /* This code is run when the App is created. Include code that creates your WebView */ super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_main ) ; Toolbar toolbar = ( Toolbar ) findViewById ( R . id . toolbar ) ; setSupportActionBar ( toolbar ) ; /*
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        }); */ WebView webView = ( WebView ) findViewById ( R . id . oscar ) ; WebViewClient minapp = new WebViewClient ( ) ; webView . setWebViewClient ( minapp ) ; WebSettings webSettings = webView . getSettings ( ) ; webSettings . setJavaScriptEnabled ( true ) ; webView . loadUrl ( "file:///android_asset/about.html" ) ; }
Create a private member variable that can hold our WebView
Create a private member variable that can hold our WebView
// The FAB-code can be removed //webView.loadUrl("http://wwwlab.iit.his.se/a14oscna/Mobil/Projekt/Main.html");