当前位置: 首页>>代码示例>>Java>>正文


Java WebView.goBack方法代码示例

本文整理汇总了Java中com.tencent.smtt.sdk.WebView.goBack方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.goBack方法的具体用法?Java WebView.goBack怎么用?Java WebView.goBack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.tencent.smtt.sdk.WebView的用法示例。


在下文中一共展示了WebView.goBack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReceivedError

import com.tencent.smtt.sdk.WebView; //导入方法依赖的package包/类
/**
 * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
 * The errorCode parameter corresponds to one of the ERROR_* constants.
 *
 * @param view          The WebView that is initiating the callback.
 * @param errorCode     The error code corresponding to an ERROR_* value.
 * @param description   A String describing the error.
 * @param failingUrl    The url that failed to load.
 */
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
    // Ignore error due to stopLoading().
    if (!isCurrentlyLoading) {
        return;
    }
    LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl);

    // If this is a "Protocol Not Supported" error, then revert to the previous
    // page. If there was no previous page, then punt. The application's config
    // is likely incorrect (start page set to sms: or something like that)
    if (errorCode == WebViewClient.ERROR_UNSUPPORTED_SCHEME) {
        parentEngine.client.clearLoadTimeoutTimer();

        if (view.canGoBack()) {
            view.goBack();
            return;
        } else {
            super.onReceivedError(view, errorCode, description, failingUrl);
        }
    }
    parentEngine.client.onReceivedError(errorCode, description, failingUrl);
}
 
开发者ID:runner525,项目名称:x5webview-cordova-plugin,代码行数:33,代码来源:X5WebViewClient.java

示例2: onReceivedError

import com.tencent.smtt.sdk.WebView; //导入方法依赖的package包/类
/**
 * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
 * The errorCode parameter corresponds to one of the ERROR_* constants.
 *
 * @param view        The WebView that is initiating the callback.
 * @param errorCode   The error code corresponding to an ERROR_* value.
 * @param description A String describing the error.
 * @param failingUrl  The url that failed to load.
 */
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
  // Ignore error due to stopLoading().
  if (!isCurrentlyLoading) {
    return;
  }
  LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl);

  // If this is a "Protocol Not Supported" error, then revert to the previous
  // page. If there was no previous page, then punt. The application's config
  // is likely incorrect (start page set to sms: or something like that)
  if (errorCode == WebViewClient.ERROR_UNSUPPORTED_SCHEME) {
    parentEngine.client.clearLoadTimeoutTimer();

    if (view.canGoBack()) {
      view.goBack();
      return;
    } else {
      super.onReceivedError(view, errorCode, description, failingUrl);
    }
  }
  parentEngine.client.onReceivedError(errorCode, description, failingUrl);
}
 
开发者ID:zsxsoft,项目名称:cordova-plugin-x5-tbs,代码行数:33,代码来源:X5WebViewClient.java


注:本文中的com.tencent.smtt.sdk.WebView.goBack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。