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

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

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

WebView.postDelayed介绍

暂无

代码示例

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

large.postDelayed(new Runnable() {

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

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

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

webView.layout(0, 0, webView.getMeasuredWidth(), webView.getMeasuredHeight());
webView.postDelayed(capture, 1000);

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

@Override   
public void onPageFinished(final WebView view, String url)   
{   
  view.postDelayed(new Runnable()   
  {      
    public void run()   
    {
      view.loadUrl("javascript:window.INTERFACE.processContent(document.getElementsByTagName('body')[0].innerText);");
    }       
  }, 5000);
}

代码示例来源:origin: wallabag/android-app

@Override
  public void run() {
    if(webViewContent.getHeight() == webViewHeightBeforeUpdate) {
      if(++counter > 1000) {
        Log.d(TAG, "restorePositionAfterUpdate() giving up");
        return;
      }
      Log.v(TAG, "restorePositionAfterUpdate() scheduling another postDelay" +
          "; counter: " + counter);
      webViewContent.postDelayed(this, 10);
    } else {
      Log.d(TAG, "restorePositionAfterUpdate() restoring position");
      restoreReadingPosition();
    }
  }
}, 10);

代码示例来源:origin: wallabag/android-app

@Override
  public void run() {
    // "< 50" is workaround for https://github.com/wallabag/android-app/issues/178
    if(webViewContent.getHeight() < 50) {
      if(++counter > 1000) {
        Log.d(TAG, "onPageFinished() exiting by counter" +
            "; calling loadingFinished() anyway");
        loadingFinished();
        return;
      }
      Log.v(TAG, "onPageFinished() scheduling another postDelay; counter: " + counter);
      webViewContent.postDelayed(this, 10);
    } else {
      Log.d(TAG, "onPageFinished() calling loadingFinished()");
      loadingFinished();
    }
  }
}, 10);

代码示例来源:origin: wallabag/android-app

private void restorePositionAfterUpdate() {
  cancelPositionRestoration();
  webViewContent.postDelayed(positionRestorationRunnable = new Runnable() {
    int counter;
    @Override
    public void run() {
      if(webViewContent.getHeight() == webViewHeightBeforeUpdate) {
        if(++counter > 1000) {
          Log.d(TAG, "restorePositionAfterUpdate() giving up");
          return;
        }
        Log.v(TAG, "restorePositionAfterUpdate() scheduling another postDelay" +
            "; counter: " + counter);
        webViewContent.postDelayed(this, 10);
      } else {
        Log.d(TAG, "restorePositionAfterUpdate() restoring position");
        restoreReadingPosition();
      }
    }
  }, 10);
}

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

@Override
  public void onLoadResource(final WebView view, final String url) {
  if(url.indexOf("googleadservices.")>-1){
 view.getSettings().setJavaScriptEnabled(false);
   view.stopLoading();
   view.postDelayed(
    new Runnable(){
    @Override
    public void run(){
     Uri uri=Uri.parse(url);
     Intent i=new Intent(Intent.ACTION_VIEW,uri);
     i.setClassName("com.android.browser","com.android.browser.BrowserActivity");
     startActivity(i);
    }
    }
     ,100
    );
  }
  }

代码示例来源:origin: zhangke3016/GeneratePicture

if (Build.VERSION.SDK_INT<21){
  if (isFirstLoad){
    webView.postDelayed(new Runnable() {
      @Override
      public void run() {

代码示例来源:origin: wallabag/android-app

webViewContent.postDelayed(new Runnable() {
  int counter;

代码示例来源:origin: calvinaquino/LNReader-Android

/**
   * KitKat chromium text zoom handler, see http://stackoverflow.com/a/20000193
   *
   * @param webView
   * @param oldScale
   * @param newScale
   */
  @Override
  public void onScaleChanged(final WebView webView, float oldScale, float newScale) {
    if (UIHelper.getKitKatWebViewFix(webView.getContext())) {
      if (scaleChangedRunnablePending) {
        Log.d(TAG, "OnScaleChange KitKat handler already running");
        return;
      }
      synchronized (webView) {
        scaleChangedRunnablePending = true;
        webView.postDelayed(new Runnable() {
          @Override
          public void run() {
            webView.loadUrl("javascript:recalcWidth();", null);
            scaleChangedRunnablePending = false;
          }
        }, UIHelper.getIntFromPreferences(Constants.PREF_KITKAT_WEBVIEW_FIX_DELAY, 500));
      }
    }
  }
}

代码示例来源:origin: Flipboard/GoldenGate

webview.postDelayed(new Runnable() {
  @Override
  public void run() {

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

webview.postDelayed(tapdown, delay);
delay += 100;
webview.postDelayed(tapup, delay);

相关文章

WebView类方法