package com.example.android.Bella;


import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

public class WebActivity extends AppCompatActivity{

    String link;
    WebView w;
    ProgressBar progressBar;



    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview_activity);
        link = getIntent().getStringExtra("link");
        Log.e("link:",link);
        progressBar = (ProgressBar) findViewById(R.id.loading_spinner);
        w = (WebView) findViewById(R.id.link);
        w.setWebViewClient(new myWebClient());
        w.loadUrl(link);

    }public class myWebClient extends WebViewClient
    {
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
            super.onPageStarted(view, url, favicon);
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            // TODO Auto-generated method stub
            progressBar.setVisibility(View.VISIBLE);
            view.loadUrl(url);
            return true;

        }

        @Override
        public void onPageFinished(WebView view, String url) {
            // TODO Auto-generated method stub
            super.onPageFinished(view, url);

            progressBar.setVisibility(View.GONE);
        }
    }

    // To handle "Back" key press event for WebView to go back to previous screen.
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if ((keyCode == KeyEvent.KEYCODE_BACK) && w.canGoBack()) {
            w.goBack();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}

@@ -258,24 +258,59 @@
 .view.View;%0A
+import android.webkit.WebSettings;%0A
 import andro
@@ -890,24 +890,123 @@
 R.id.link);%0A
+        WebSettings webSettings = w.getSettings();%0A        webSettings.setJavaScriptEnabled(true);%0A
         w.se
@@ -1071,16 +1071,21 @@
 ;%0A%0A    %7D
+%0A    
 public c

enable javascript support for webview