android.webkit.WebView.setTag()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中android.webkit.WebView.setTag()方法的一些代码示例,展示了WebView.setTag()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.setTag()方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:setTag

WebView.setTag介绍

暂无

代码示例

代码示例来源: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: androidquery/androidquery

/**
 * Clear a view. Applies to ImageView, WebView, and TextView.
 *
 * @return self
 */
public T clear(){
  
  if(view != null){
    
    if(view instanceof ImageView){
      ImageView iv = ((ImageView) view);
      iv.setImageBitmap(null);
      iv.setTag(AQuery.TAG_URL, null);
    }else if(view instanceof WebView){
      WebView wv = ((WebView) view);
      wv.stopLoading();
      wv.clearView();
      wv.setTag(AQuery.TAG_URL, null);
    }else if(view instanceof TextView){
      TextView tv = ((TextView) view);
      tv.setText("");
    }
    
    
  }
  
  return self();
}

代码示例来源:origin: wangdan/AisenWeiBo

large.loadDataWithBaseURL("file:///android_asset/", str2, "text/html", "utf-8", null);
large.setTag(new Object());
large.postDelayed(new Runnable() {

代码示例来源:origin: androidquery/androidquery

wv.setTag(AQuery.TAG_URL, url);

代码示例来源:origin: iTXTech/Daedalus

@Override
  public void onDestroyView() {
    super.onDestroyView();

    if (mWebView != null) {
      Log.d("DAboutActivity", "onDestroy");

      mWebView.removeAllViews();
      mWebView.setWebViewClient(null);
      ((ViewGroup) mWebView.getParent()).removeView(mWebView);
      mWebView.setTag(null);
      mWebView.clearHistory();
      mWebView.destroy();
      mWebView = null;
    }
  }
}

代码示例来源:origin: stackoverflow.com

@Override
public void onPageFinished(WebView view, String url)
{
  System.out.println("onPageFinished: " + url);
  if ("about:blank".equals(url) && view.getTag() != null)
  {
    view.loadUrl(view.getTag().toString());
  }
  else
  {
    view.setTag(url);
  }
}

代码示例来源:origin: stackoverflow.com

@Override
public void onPageFinished(WebView view, String url)
{
  System.out.println("onPageFinished: " + url);
  if ("about:blank".equals(url) && view.getTag() != null)
  {
    view.loadUrl(view.getTag().toString());
  }
  else
  {
    view.setTag(url);
  }
}

代码示例来源:origin: stackoverflow.com

private static final class WebViewHolder {
  WebView wv;
}

@Override
public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
  WebViewHolder holder = new WebViewHolder();
  if (key.equals("webviewUrl")) {
    if (wv == null) {
      wv = new WebView(this);
      holder.wv = (WebView) findViewById(R.id.rss_webview);
      holder.wv.getSettings().setJavaScriptEnabled(true);
      holder.wv.setWebViewClient(new MyWebViewClient());
      wv.setTag(holder);
    } else {
      holder = (WebViewHolder) wv.getTag(); 
    }
    holder.wv.loadUrl("about:blank");
    holder.wv.loadUrl(pref.getString(key, null));
  }
}

代码示例来源:origin: xudjx/webprogress

private void clearWebView(WebView m) {
    if (m == null)
      return;
    if (Looper.myLooper() != Looper.getMainLooper())
      return;
    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: com.googlecode.android-query/android-query

/**
 * Clear a view. Applies to ImageView, WebView, and TextView.
 *
 * @return self
 */
public T clear(){
  
  if(view != null){
    
    if(view instanceof ImageView){
      ImageView iv = ((ImageView) view);
      iv.setImageBitmap(null);
      iv.setTag(AQuery.TAG_URL, null);
    }else if(view instanceof WebView){
      WebView wv = ((WebView) view);
      wv.stopLoading();
      wv.clearView();
      wv.setTag(AQuery.TAG_URL, null);
    }else if(view instanceof TextView){
      TextView tv = ((TextView) view);
      tv.setText("");
    }
    
    
  }
  
  return self();
}

代码示例来源:origin: grzegorznittner/chanu

myWebView.setTag(localPlayUri + "#" + version);

代码示例来源:origin: ymback/NGA-CLIENT-VER-OPEN-SOURCE

@SuppressWarnings("static-access")
public static void handleContentTV(final WebView contentTV, final MessageArticlePageInfo row, int bgColor, int fgColor, Context context) {
  final WebViewClient client = new WebViewClientEx((FragmentActivity) context);
  contentTV.setBackgroundColor(0);
  contentTV.setFocusableInTouchMode(false);
  contentTV.setFocusable(false);
  contentTV.setLongClickable(false);
  WebSettings setting = contentTV.getSettings();
  setting.setUserAgentString(context.getString(R.string.clientua) + BuildConfig.VERSION_CODE);
  setting.setDefaultFontSize(PhoneConfiguration.getInstance()
      .getWebSize());
  setting.setJavaScriptEnabled(false);
  contentTV.setWebViewClient(client);
  contentTV.setTag(row.getLou());
  contentTV.loadDataWithBaseURL(null, row.getFormated_html_data(),
      "text/html", "utf-8", null);
}

代码示例来源:origin: andforce/iBeebo

webView.loadDataWithBaseURL("file:///android_asset/", str2, "text/html", "utf-8", null);
webView.setTag(new Object());

代码示例来源:origin: com.googlecode.android-query/android-query

wv.setTag(AQuery.TAG_URL, url);

相关文章

WebView类方法