@Override public void onPause() { super.onPause(); if (mWebView != null) { mWebView.onPause(); } }
/** * Called when the Fragment is no longer resumed. This is generally tied to {@link * Activity#onPause() Activity.onPause} of the containing Activity's lifecycle. */ @Override public void onPause() { super.onPause(); if (block != null) { block.onPause(); } }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override protected void onPause() { super.onPause(); MobclickAgent.onPause(this); mWebContent.onPause(); if (mWakeLock != null) { try { if (mWakeLock.isHeld()) mWakeLock.release(); } catch (Exception e) { Trace.d(tag, e.getMessage()); } } }
@Override @TargetApi(Build.VERSION_CODES.HONEYCOMB) public void onPause() { // reset activity title if (BuildConfig.DEBUG) { Log.d(TAG, "Pausing webview fragment"); } ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(R.string.app_name); if ((AppUtils.isAPILevel11Available()) && (webView != null)) { webView.onPause(); } super.onPause(); }
private void showDialogBoxAndClosePopup( final boolean isVideoPopup, final PopupWindow popupWindow) { AlertDialog.Builder alertbox = new AlertDialog.Builder(trainingActivity); // set the message to display alertbox.setMessage("Do you really want to quit?"); alertbox.setCancelable(false); if (isVideoPopup) { webView.onPause(); } // set a positive/yes button and create a listener alertbox.setPositiveButton( "Yes", new DialogInterface.OnClickListener() { // do something when the button is clicked public void onClick(DialogInterface arg0, int arg1) { if (isVideoPopup) { webView.destroy(); popUpViewVideo = null; popupWindow.dismiss(); Toast.makeText(trainingActivity, "Video Closed", Toast.LENGTH_LONG).show(); } else { popUpViewText = null; popupWindow.dismiss(); Toast.makeText(trainingActivity, "Description Closed", Toast.LENGTH_LONG).show(); } } }); // set a negative/no button and create a listener alertbox.setNegativeButton( "No", new DialogInterface.OnClickListener() { // do something when the button is clicked public void onClick(DialogInterface arg0, int arg1) { if (isVideoPopup) webView.onResume(); } }); alertbox.show(); }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) private void pauseWebView() { if (mWebView != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) mWebView.onPause(); }
@Override public void onPause() { super.onPause(); mWebView.onPause(); }
@Override protected void onPause() { if (mWebView != null) mWebView.onPause(); super.onPause(); MobclickAgent.onPause(this); }
@Test public void shouldRecordOnPause() { assertThat(shadowWebView.wasOnPauseCalled()).isFalse(); webView.onPause(); assertThat(shadowWebView.wasOnPauseCalled()).isTrue(); }
@Override public void onPause() { super.onPause(); // To change body of overridden methods use File | // Settings | File Templates. webView.onPause(); }
@Override protected void onPause() { super.onPause(); if (mWebView != null) mWebView.onPause(); }
@Override protected void onDestroy() { super.onDestroy(); webView.onPause(); }