Example usage for android.webkit WebView setWebViewClient

List of usage examples for android.webkit WebView setWebViewClient

Introduction

In this page you can find the example usage for android.webkit WebView setWebViewClient.

Prototype

public void setWebViewClient(WebViewClient client) 

Source Link

Document

Sets the WebViewClient that will receive various notifications and requests.

Usage

From source file:com.ezac.gliderlogs.FlightNotamBLXActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from  ww  w  .j ava 2 s . c  o  m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.loadUrl("http://www.notaminfo.com/belgiummap");

}

From source file:com.ezac.gliderlogs.FlightNotamNLDActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from ww  w .j a v a 2  s  . c  o m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.loadUrl("http://www.zweefvlieg.net/notam2014/");

}

From source file:com.ezac.gliderlogs.FlightRaspActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from   w w  w .j a  v a2  s.  c  om*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.loadUrl("http://blipmaps.nl/showblipmap.php?Param=sfctemp&Day=0&Time=1130&Lang=En&Stage=1");

}

From source file:com.google.android.apps.gutenberg.LicensesFragment.java

@NonNull
@Override//ww w .  j  av  a2 s  . co m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    WebView webView = new WebView(getActivity());
    webView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (!TextUtils.isEmpty(url) && Patterns.WEB_URL.matcher(url).matches()) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
                return true;
            } else {
                return false;
            }
        }
    });
    webView.loadUrl("file:///android_asset/licenses.html");
    return new AlertDialog.Builder(getActivity()).setTitle(R.string.licenses).setView(webView)
            .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    dialog.dismiss();
                }
            }).create();
}

From source file:com.commonsware.android.feedfrags.ContentFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    WebView browser = getBrowser();

    browser.setWebViewClient(new RedirectFixer());
    browser.getSettings().setJavaScriptEnabled(true);

    if (savedInstanceState != null) {
        browser.restoreState(savedInstanceState);
    } else if (urlToLoad != null) {
        loadUrl(urlToLoad);/* ww w .  jav  a 2s . c om*/
    }
}

From source file:com.ezac.gliderlogs.FlightADSBActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from   w  ww. ja  v  a 2 s  . c  o m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://86.83.189.66:8099//gmap.php");
}

From source file:com.ezac.gliderlogs.FlightGliderActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/* www .  j a  v a  2 s  .  c  o  m*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://live.glidertracking.com/index.php");
}

From source file:com.ezac.gliderlogs.FlightOGNActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.view_list);/*from   w w  w.  jav  a 2s.c om*/

    // hide soft keyboard
    setMode();

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://live.glidernet.org/#c=51.27405,3.93909&z=11");
}

From source file:com.hhs.hfnavigator.slidingtabs.harbinger.SportsFragment.java

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null);

    WebView webView = (WebView) root.findViewById(R.id.webView);
    if (webView != null) {
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("http://www.harbingernews.net/sports");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        webView.getSettings().setBuiltInZoomControls(true);
    }//from w  w w .ja v  a  2 s .co m
    return root;
}

From source file:com.ezac.gliderlogs.FlightEzacActivity.java

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.ezac_list);/*from   www. j  av  a 2  s  .  c  o m*/

    // hide soft keyboard
    setMode();

    Button close = (Button) findViewById(R.id.button_close);

    WebView browser = (WebView) findViewById(R.id.webview_1);
    browser.setWebViewClient(new WebViewClient());
    browser.getSettings().setSupportZoom(true);
    browser.getSettings().setBuiltInZoomControls(true);
    browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    browser.setScrollbarFadingEnabled(true);
    browser.getSettings().setLoadsImagesAutomatically(true);
    browser.getSettings().setDomStorageEnabled(true);
    browser.getSettings().setAppCacheEnabled(true);
    browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32);
    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    browser.getSettings().setAppCachePath(appCachePath);
    browser.getSettings().setAllowFileAccess(true);
    browser.getSettings().setJavaScriptEnabled(true);
    browser.loadUrl("http://www.ezac.nl/drupal/");

    close.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            setResult(RESULT_OK);
            finish();
        }
    });
}