@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1) @Test public void pause_withIsFinishingTrue_shouldStopLoading_shouldLoadBlankUrl_shouldPauseWebView() throws Exception { WebView mockWebView = mock(WebView.class); WebViews.onPause(mockWebView, true); verify(mockWebView).stopLoading(); verify(mockWebView).loadUrl(""); verify(mockWebView).onPause(); }
@TargetApi(VERSION_CODES.HONEYCOMB) public static void onPause(@NonNull WebView webView, boolean isFinishing) { if (isFinishing) { webView.stopLoading(); webView.loadUrl(""); } if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { webView.onPause(); return; } try { new MethodBuilder(webView, "onPause").setAccessible().execute(); } catch (Exception e) { } }
WebViews { @TargetApi(VERSION_CODES.HONEYCOMB) public static void onPause(@NonNull WebView webView, boolean isFinishing) { if (isFinishing) { webView.stopLoading(); webView.loadUrl(""); } if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { webView.onPause(); return; } try { new MethodBuilder(webView, "onPause").setAccessible().execute(); } catch (Exception e) { } } }
WebViews { @TargetApi(VERSION_CODES.HONEYCOMB) public static void onPause(@NonNull WebView webView, boolean isFinishing) { if (isFinishing) { webView.stopLoading(); webView.loadUrl(""); } if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { webView.onPause(); return; } try { new MethodBuilder(webView, "onPause").setAccessible().execute(); } catch (Exception e) { } }  }
WebViews { @TargetApi(VERSION_CODES.HONEYCOMB) public static void onPause(@NonNull WebView webView, boolean isFinishing) { if (isFinishing) { webView.stopLoading(); webView.loadUrl(""); } if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { webView.onPause(); return; } try { new MethodBuilder(webView, "onPause").setAccessible().execute(); } catch (Exception e) { } }  @TargetApi(VERSION_CODES.HONEYCOMB) static void onResume(@NonNull WebView webView); @TargetApi(VERSION_CODES.HONEYCOMB) static void onPause(@NonNull WebView webView, boolean isFinishing); static void setDisableJSChromeClient(WebView webView); }
WebViews { @TargetApi(VERSION_CODES.HONEYCOMB) public static void onPause(@NonNull WebView webView, boolean isFinishing) { if (isFinishing) { webView.stopLoading(); webView.loadUrl(""); } if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { webView.onPause(); return; } try { new MethodBuilder(webView, "onPause").setAccessible().execute(); } catch (Exception e) { } }  @TargetApi(VERSION_CODES.HONEYCOMB) static void onResume(@NonNull WebView webView); @TargetApi(VERSION_CODES.HONEYCOMB) static void onPause(@NonNull WebView webView, boolean isFinishing); static void setDisableJSChromeClient(WebView webView);  }