本文整理了Java中android.webkit.WebView.destroy()
方法的一些代码示例,展示了WebView.destroy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.destroy()
方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:destroy
暂无
代码示例来源:origin: TheFinestArtist/FinestWebView-Android
@Override
public void run() {
if (webView != null) {
webView.destroy();
}
}
}, ViewConfiguration.getZoomControlsTimeout() + 1000L);
代码示例来源:origin: commonsguy/cw-omnibus
/**
* Called when the fragment is no longer in use. Destroys the internal state of the WebView.
*/
@Override
public void onDestroy() {
if (mWebView != null) {
mWebView.destroy();
mWebView = null;
}
super.onDestroy();
}
代码示例来源:origin: commonsguy/cw-omnibus
/**
* Called when the fragment is no longer in use. Destroys
* the internal state of the WebView.
*/
@Override
public void onDestroy() {
if (mWebView != null) {
mWebView.destroy();
mWebView=null;
}
super.onDestroy();
}
代码示例来源:origin: TommyLemon/APIJSON
@Override
protected void onDestroy() {
super.onDestroy();
if (wvWebView != null) {
wvWebView.destroy();
wvWebView = null;
}
wvWebView = null;
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
protected void onDestroy() {
mWebView.destroy();
mHandler.removeCallbacksAndMessages(null);
super.onDestroy();
}
}
代码示例来源:origin: TommyLemon/Android-ZBLibrary
@Override
protected void onDestroy() {
if (wvWebView != null) {
wvWebView.destroy();
wvWebView = null;
}
super.onDestroy();
}
代码示例来源:origin: seven332/EhViewer
@Override
protected void onDestroy() {
super.onDestroy();
if (null != mWebView) {
mWebView.destroy();
mWebView = null;
}
}
代码示例来源:origin: seven332/EhViewer
@Override
public void onDestroyView() {
super.onDestroyView();
if (null != mWebView) {
mWebView.destroy();
mWebView = null;
}
}
代码示例来源:origin: ankidroid/Anki-Android
private void destroyWebView(WebView webView) {
if (webView != null) {
webView.stopLoading();
webView.setWebChromeClient(null);
webView.setWebViewClient(null);
webView.destroy();
}
}
代码示例来源:origin: Aspsine/SwipeToLoadLayout
@Override
public void onDestroy() {
super.onDestroy();
if (webView != null) {
webView.destroy();
}
}
代码示例来源:origin: wangdan/AisenWeiBo
@Override
public void onDestroy() {
super.onDestroy();
mWebView.destroy();
}
代码示例来源:origin: stackoverflow.com
public class TestActivity extends Activity {
private FrameLayout mWebContainer;
private WebView mWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.your_layout);
mWebContainer = (FrameLayout) findViewById(R.id.web_container);
mWebView = new WebView(getApplicationContext());
mWebContainer.addView(mWebView);
}
@Override
protected void onDestroy() {
super.onDestroy();
mWebContainer.removeAllViews();
mWebView.destroy();
}
}
代码示例来源:origin: commonsguy/cw-omnibus
/**
* 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(getContext());
mIsWebViewAvailable = true;
return mWebView;
}
代码示例来源:origin: jaydenxiao2016/AndroidFire
@Override
protected void onDestroy() {
if(webView!=null) {
webView.removeAllViews();
webView.destroy();
}
super.onDestroy();
}
代码示例来源:origin: commonsguy/cw-omnibus
/**
* 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(getContext());
mIsWebViewAvailable=true;
return mWebView;
}
代码示例来源:origin: Justson/AgentWeb
static final void clearWebView(WebView m) {
if (m == null) {
return;
}
if (Looper.myLooper() != Looper.getMainLooper()) {
return;
}
m.loadUrl("about:blank");
m.stopLoading();
if (m.getHandler() != null) {
m.getHandler().removeCallbacksAndMessages(null);
}
m.removeAllViews();
ViewGroup mViewGroup = null;
if ((mViewGroup = ((ViewGroup) m.getParent())) != null) {
mViewGroup.removeView(m);
}
m.setWebChromeClient(null);
m.setWebViewClient(null);
m.setTag(null);
m.clearHistory();
m.destroy();
m = null;
}
代码示例来源:origin: Justson/AgentWeb
@Override
public void destroy() {
setVisibility(View.GONE);
if (mJsCallJavas != null) {
mJsCallJavas.clear();
}
if (mInjectJavaScripts != null) {
mInjectJavaScripts.clear();
}
removeAllViewsInLayout();
fixedStillAttached();
releaseConfigCallback();
if (mIsInited) {
resetAccessibilityEnabled();
//
LogUtils.i(TAG, "destroy web");
super.destroy();
}
}
代码示例来源:origin: xinghongfei/LookLook
@Override
protected void onDestroy() {
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {
getWindow().getSharedElementReturnTransition().removeListener(zhihuReturnHomeListener);
}
//webview内存泄露
if (wvZhihu != null) {
((ViewGroup) wvZhihu.getParent()).removeView(wvZhihu);
wvZhihu.destroy();
wvZhihu = null;
}
mIZhihuStoryPresenter.unsubscrible();
super.onDestroy();
}
代码示例来源:origin: seven332/EhViewer
@Override
protected void onDestroy() {
super.onDestroy();
webView.destroy();
// Put cookies back to okhttp cookie store
CookieManager cookieManager = CookieManager.getInstance();
String cookiesString = cookieManager.getCookie(url);
if (cookiesString != null && !cookiesString.isEmpty()) {
EhCookieStore store = EhApplication.getEhCookieStore(this);
HttpUrl eUrl = HttpUrl.parse(EhUrl.HOST_E);
HttpUrl exUrl = HttpUrl.parse(EhUrl.HOST_EX);
// The cookies saved in the uconfig page should be shared between e and ex
for (String header : cookiesString.split(";")) {
Cookie eCookie = Cookie.parse(eUrl, header);
if (eCookie != null) {
store.addCookie(longLive(eCookie));
}
Cookie exCookie = Cookie.parse(exUrl, header);
if (exCookie != null) {
store.addCookie(longLive(exCookie));
}
}
}
}
代码示例来源:origin: robolectric/robolectric
@Test
public void shouldRecordDestroy() {
assertThat(shadowOf(webView).wasDestroyCalled()).isFalse();
webView.destroy();
assertThat(shadowOf(webView).wasDestroyCalled()).isTrue();
}
内容来源于网络,如有侵权,请联系作者删除!