protected void killWebViewLowMemory(WebView mWebView) { // http://stackoverflow.com/questions/3815090/webview-and-html5-video if (mWebView == null) { if (block.getVisibility() != View.GONE && block != null) { block.setVisibility(View.GONE); block.loadUrl("about:blank"); block.destroy(); } } else if (mWebView.getVisibility() != View.GONE) { mWebView.setVisibility(View.GONE); mWebView.loadUrl("about:blank"); mWebView.destroy(); } }
@Override public void destroy() { if (client != null) { client.getBinding().destroy(); } super.destroy(); }
public void setToNormal() { if (mPreview != null) { mPreview.stopPreview(); } FrameLayout layout = (FrameLayout) findViewById(R.id.linear); layout.removeView(mWebView); layout.setLayoutParams( new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); mWebView.setWebViewClient(null); mWebView.destroy(); mWebView = null; FrameLayout frame = (FrameLayout) findViewById(R.id.camera_parent); frame.setLayoutParams( new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); displayNormalMode(); mMaskFlag = false; // setTitle(R.string.app_name); setTitle(""); if (mPreview != null) { mPreview.startPreview(); } }
@Override protected void onStop() { super.onStop(); mFacadeManager.getReceiver(EventFacade.class).removeEventObserver(mObserver); mWebView.destroy(); finish(); }
@Override public void onDestroy() { mWebView.getSettings().setBuiltInZoomControls(false); super.onDestroy(); mWebView.setVisibility(View.GONE); mWebView.destroy(); }
/** Called to instantiate the view. Creates and returns the WebView. */ @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (mWebView != null) { mWebView.destroy(); } mWebView = new WebView(getActivity()); View myFragmentView = inflater.inflate(R.layout.news_feed_fragment, container, false); progress = ProgressDialog.show(getActivity(), "Loading", "Please wait...", true); mWebView.setWebViewClient( new InnerWebViewClient() { public void onPageFinished(WebView view, String url) { if (progress != null) { progress.dismiss(); } super.onPageFinished(view, url); } }); // forces it to open in app mWebView.loadUrl(mUrl); mIsWebViewAvailable = true; WebSettings settings = mWebView.getSettings(); settings.setJavaScriptEnabled(true); return mWebView; }
@Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_reset_webview: if (mWebView != null) { ViewGroup container = getContainer(); container.removeView(mWebView); mWebView.destroy(); mWebView = null; } createAndInitializeWebView(); return true; case R.id.menu_clear_cache: if (mWebView != null) { mWebView.clearCache(true); } return true; case R.id.menu_about: about(); hideKeyboard(mUrlBar); return true; default: return false; } }
@Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); if (mWebView != null) { mWebView.destroy(); } }
@Override public void onDestroyView() { if (mWebView != null) { mWebView.destroy(); } ButterKnife.reset(this); super.onDestroyView(); }
@Override public void onDestroy() { if (mWebView != null) { mWebView.destroy(); mWebView = null; } super.onDestroy(); }
@Override protected void onDestroy() { super.onDestroy(); if (mWebView != null) { mWebView.removeAllViews(); mWebView.destroy(); } ButterKnife.unbind(this); }
@Override public void destroy() { super.destroy(); try { if (sConfigCallback != null) sConfigCallback.set(null, null); } catch (Exception e) { throw new RuntimeException(e); } }
@Override protected void onDestroy() { webView.loadUrl("about:blank"); webView.destroy(); webView = null; if (listener != null) listener.onPageClose(); listener = null; super.onDestroy(); }
@Override public synchronized void destroy() { stopLoading(); onPause(); clearHistory(); setVisibility(GONE); removeAllViews(); destroyDrawingCache(); super.destroy(); }
@Override protected void onDestroy() { super.onDestroy(); if (wvIt != null) { ((ViewGroup) wvIt.getParent()).removeView(wvIt); wvIt.destroy(); wvIt = null; } mIItHomeArticlePresenter.unsubcrible(); }
/** Called to instantiate the view. Creates and returns the WebView. */ @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (mWebView != null) { mWebView.destroy(); } mWebView = new WebView(getActivity()); mIsWebViewAvailable = true; return mWebView; }
@Override public void onDestroy() { super.onDestroy(); if (mWebView != null) { removeViewInLayout(mWebView); mWebView.destroyDrawingCache(); mWebView.destroy(); mWebView = null; } ((CycleControllerActivity) getContext()).getCycleController().unregister(this, false); }
@Override protected void onDestroy() { super.onDestroy(); mWebView.stopLoading(); ViewGroup webParent = (ViewGroup) mWebView.getParent(); if (webParent != null) { webParent.removeView(mWebView); } mWebView.destroy(); }
@Override protected void onDestroy() { super.onDestroy(); if (mWebView != null) { mWebView.stopLoading(); mWebView.setWebChromeClient(null); mWebView.setWebViewClient(null); mWebView.destroy(); mWebView = null; } }
// Added to fix the memory leak caused due to bug in android which stops activities with // webview to be GCed. // Refer to this link for more details - http://code.google.com/p/android/issues/detail?id=9375 @Override protected void onDestroy() { super.onDestroy(); if (webView != null) { webView.destroy(); webView = null; } if (updateController != null) updateController.destroy(); }
@Override protected void onDestroy() { super.onDestroy(); if (webViewer != null) { webViewer.setVisibility(View.GONE); webViewer.clearCache(true); webViewer.clearHistory(); webViewer.destroy(); } }
@Override protected void onDestroy() { super.onDestroy(); try { MetaioCloudUtils.unbindDrawables(findViewById(android.R.id.content)); mWebView.destroy(); } catch (Exception e) { } }
/* * (non-Javadoc) * * @see com.mckuai.imc.activity.BaseActivity#finish() */ @Override public void finish() { // TODO Auto-generated method stub if (null != webView) { ViewGroup parent = (ViewGroup) webView.getParent(); if (null != parent) { parent.removeAllViews(); } webView.removeAllViews(); webView.destroy(); } super.finish(); }
/** 退出系统 * */ private void exit() { contentWebView.loadUrl("about:blank"); // Activity专用的推退出 // webView.clearCache(true); contentWebView.clearView(); // webView.clearHistory(); contentWebView.destroy(); toolbarWebView.clearHistory(); finish(); // 通过结束进程 android.os.Process.killProcess(android.os.Process.myPid()); // 通过Activity自带的ActivityService来结束应用程序 系统会将,该包下的 // ,所有进程,服务,全部杀掉,就可以杀干净了 ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); am.restartPackage(getPackageName()); // 系统级别的退出 其中传递的状态码 表示退出的级别 System.exit(-1); }
@Override protected void onStop() { if (Config.LOGD) Log.i(LOGTAG, "onStop"); if (mService != null && !pinSent) { // let the service know that login has been aborted if (Config.LOGD) Log.i(LOGTAG, "onStop mService.twitterLogin(null) ..."); mService.twitterLogin(null); } if (serviceConnection != null) { if (Config.LOGD) Log.i(LOGTAG, "onStop unbindService() ..."); unbindService(serviceConnection); // our service will continue to run, it was running before this activity was started serviceConnection = null; } if (myWebView != null) { if (Config.LOGD) Log.i(LOGTAG, "onStop myWebView.destroy() ..."); myWebView.destroy(); myWebView = null; } mService = null; super.onStop(); }
public void onDestroy() { if (mQuotedTextWebView != null) { mQuotedTextWebView.destroy(); } }
public void destroy() { view.destroy(); }
@Test public void shouldRecordDestroy() { assertThat(shadowWebView.wasDestroyCalled()).isFalse(); webView.destroy(); assertThat(shadowWebView.wasDestroyCalled()).isTrue(); }
@Override protected void onDestroy() { super.onDestroy(); if (mWebView != null) mWebView.destroy(); ButterKnife.unbind(this); }
@Override public void onDestroy() { super.onDestroy(); mWebView.destroy(); }