當前位置: 首頁>>代碼示例>>Java>>正文


Java WebView.destroy方法代碼示例

本文整理匯總了Java中android.webkit.WebView.destroy方法的典型用法代碼示例。如果您正苦於以下問題:Java WebView.destroy方法的具體用法?Java WebView.destroy怎麽用?Java WebView.destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.webkit.WebView的用法示例。


在下文中一共展示了WebView.destroy方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearWebView

import android.webkit.WebView; //導入方法依賴的package包/類
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;


    }
 
開發者ID:Justson,項目名稱:AgentWeb,代碼行數:24,代碼來源:AgentWebUtils.java

示例2: hasWebView

import android.webkit.WebView; //導入方法依賴的package包/類
public static boolean hasWebView(Context context) {
    if (mHasWebView != null) {
        if (!mHasWebView)
            SimplexToast.show(context, "Not WebView for you phone");
        return mHasWebView;
    }
    try {
        WebView webView = new WebView(context);
        webView.destroy();
        mHasWebView = true;
    } catch (Exception e) {
        e.printStackTrace();
        mHasWebView = false;
        SimplexToast.show(context, "Not WebView for you phone");
    }
    return mHasWebView;
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:18,代碼來源:TDevice.java

示例3: hasWebView

import android.webkit.WebView; //導入方法依賴的package包/類
public static boolean hasWebView(Context context) {
    if (mHasWebView != null) {
        if (!mHasWebView) {
            Toast.makeText(context, "Not WebView for you phone", Toast.LENGTH_SHORT).show();
        }
        return mHasWebView;
    }
    try {
        WebView webView = new WebView(context);
        webView.destroy();
        mHasWebView = true;
    } catch (Exception e) {
        e.printStackTrace();
        mHasWebView = false;
        Toast.makeText(context, "Not WebView for you phone", Toast.LENGTH_SHORT).show();
    }
    return mHasWebView;
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:19,代碼來源:TDevice.java

示例4: applyLocale

import android.webkit.WebView; //導入方法依賴的package包/類
@Override
public void applyLocale() {
    Context context = getContext();
    final LocaleManager localeManager = LocaleManager.getInstance();
    if (!localeManager.isMirroringSystemLocale(context)) {
        final Locale currentLocale = localeManager.getCurrentLocale(context);
        Locale.setDefault(currentLocale);
        final Resources resources = context.getResources();
        final Configuration config = resources.getConfiguration();
        config.setLocale(currentLocale);
        context.getResources().updateConfiguration(config, null);
    }
    // We create and destroy a new WebView here to force the internal state of WebView to know
    // about the new language. See issue #666.
    final WebView unneeded = new WebView(getContext());
    unneeded.destroy();
}
 
開發者ID:mozilla-mobile,項目名稱:firefox-tv,代碼行數:18,代碼來源:WebFragment.java

示例5: onDestroy

import android.webkit.WebView; //導入方法依賴的package包/類
/** Called when the activity is finally destroyed or in portrait-landscape switch. */
  @Override
  public void onDestroy()	{
// mhistoricalRecMgr.flush();	// shouldn't be done here because onDestroy is not called when switch to home screen and put smartmath background.

  	// release memory of wvOutput.
  	WebView wvOutput = (WebView) findViewById(R.id.webviewSmartMathOutput);
  	if (wvOutput != null)	{
	ViewGroup viewGroup = (ViewGroup) wvOutput.getParent();
	if (viewGroup != null)
	{
		viewGroup.removeView(wvOutput);
	}
	wvOutput.setFocusable(true);
	wvOutput.removeAllViews();
	wvOutput.clearHistory();
	wvOutput.destroy();
  	}
  	if (isFinishing())	{
  		MFPAdapter.clear();
  	}
  	try	{
  		super.onDestroy();
  	} catch(Exception e)	{
  		// have to add this for Amazon because at com.amazon.android.Kiwi.onDestroy(Unknown Source) it may throw exceptions.
  	}
  	if (isFinishing())	{
  		System.exit(0);	// clear memory so that if adView get problem, it can really restart.
  	}
  }
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:31,代碼來源:ActivitySmartCalc.java

示例6: clearCache

import android.webkit.WebView; //導入方法依賴的package包/類
private void clearCache() {
    WebView webView = new WebView(mActivity);
    webView.clearCache(true);
    webView.destroy();
    Utils.showSnackbar(mActivity, R.string.message_cache_cleared);
}
 
開發者ID:XndroidDev,項目名稱:Xndroid,代碼行數:7,代碼來源:PrivacySettingsFragment.java


注:本文中的android.webkit.WebView.destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。