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


Java WebView.stopLoading方法代码示例

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


在下文中一共展示了WebView.stopLoading方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onPageFinished

import android.webkit.WebView; //导入方法依赖的package包/类
public void onPageFinished(WebView view, String url) {
    try {
        String path = new URL(url).getPath();
        LogInfo.log("ZSM onPageFinished path = " + path);
        if (path.contains("checklogin")) {
            LeResponseMessage response = LeMessageManager.getInstance().dispatchMessage(new LeMessage(LeMessageIds.MSG_WEBVIEW_COOKIE_SSO_TOKEN, url));
            if (LeResponseMessage.checkResponseMessageValidity(response, String.class)) {
                PreferencesManager.getInstance().setSso_tk((String) response.getData());
            }
            view.setVisibility(4);
            view.loadUrl("javascript:window.handler.show(document.body.innerText);");
            view.stopLoading();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:HongKongLoginWebview.java

示例3: shouldOverrideUrlLoading

import android.webkit.WebView; //导入方法依赖的package包/类
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    try {
        if (url.indexOf("?") > 0) {
            String u = url.substring(0, url.indexOf("?"));
            if (TextUtils.isEmpty(u)) {
                return super.shouldOverrideUrlLoading(view, url);
            }
            if (PointsWeb.this.jumpType == 0) {
                if (!".mp4".equals(u.substring(u.lastIndexOf("."), u.length())) || !url.contains("vtype=mp4")) {
                    return super.shouldOverrideUrlLoading(view, url);
                }
                view.stopLoading();
                if (!PointsWeb.this.isFinish) {
                    Intent intent = new Intent("android.intent.action.VIEW");
                    intent.setDataAndType(Uri.parse(url), "video/mp4");
                    intent.putExtra("android.intent.extra.screenOrientation", 0);
                    PointsWeb.this.startActivity(intent);
                }
                return true;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return super.shouldOverrideUrlLoading(view, url);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:27,代码来源:PointsWeb.java

示例4: shouldOverrideUrlLoading

import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if( url.startsWith("http:") || url.startsWith("https:") ) {
        return false;
    }
    // Otherwise allow the OS to handle things like tel, mailto, etc.
    view.stopLoading();
    return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:CustomWebView.java

示例5: stopLoading

import android.webkit.WebView; //导入方法依赖的package包/类
public UDWebView stopLoading() {
    WebView view = null;
    if (this.getView() != null && (view = this.getView().getWebView()) != null) {
        view.stopLoading();
    }

    return this;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:9,代码来源:UDWebView.java

示例6: onPageFinished

import android.webkit.WebView; //导入方法依赖的package包/类
public void onPageFinished(WebView view, String url) {
    try {
        if (new URL(url).getPath().contains("callbackdata")) {
            view.setVisibility(4);
            view.loadUrl("javascript:window.handler.show(document.body.innerText);");
            view.stopLoading();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:LetvOpenIDOAuthLoginActivity.java

示例7: shouldOverrideUrlLoading

import android.webkit.WebView; //导入方法依赖的package包/类
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
    if (!AuthActivity.a(this.a, str)) {
        return super.shouldOverrideUrlLoading(webView, str);
    }
    webView.stopLoading();
    return true;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:AuthActivity.java

示例8: onPageStarted

import android.webkit.WebView; //导入方法依赖的package包/类
public void onPageStarted(WebView view, String url, Bitmap favicon) {
    if (this.mCallBack != null) {
        this.mCallBack.onPageStartedCallBack(view, url, favicon);
    }
    if (!url.startsWith(this.mAuthRequestParam.getAuthInfo().getRedirectUrl()) || this.isCallBacked) {
        super.onPageStarted(view, url, favicon);
        return;
    }
    this.isCallBacked = true;
    handleRedirectUrl(url);
    view.stopLoading();
    WeiboSdkBrowser.closeBrowser(this.mAct, this.mAuthRequestParam.getAuthListenerKey(), null);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:AuthWeiboWebViewClient.java

示例9: handleUrlLoad

import android.webkit.WebView; //导入方法依赖的package包/类
private boolean handleUrlLoad(WebView view, String url) {
    // prevent loading content that isn't ours
    if (!url.startsWith(Constants.WEBAPP_URL)) {
        // stop loading
        view.stopLoading();

        // open external URL in Browser/3rd party apps instead
        try {
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            if (intent.resolveActivity(activity.getPackageManager()) != null) {
                activity.startActivity(intent);
            } else {
                showNoAppDialog(activity);
            }
        } catch (Exception e) {
            showNoAppDialog(activity);
        }
        // return value for shouldOverrideUrlLoading
        return true;
    } else {
        // let WebView load the page!
        // activate loading animation screen
        uiManager.setLoading(true);
        // return value for shouldOverrideUrlLoading
        return false;
    }
}
 
开发者ID:xtools-at,项目名称:Android-PWA-Wrapper,代码行数:28,代码来源:WebViewHelper.java

示例10: shouldOverrideUrlLoading

import android.webkit.WebView; //导入方法依赖的package包/类
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
    if (str.startsWith(this.b)) {
        webView.setVisibility(4);
        webView.stopLoading();
        this.a.finish();
        new e(this, str).start();
    } else {
        webView.loadUrl(str);
    }
    return true;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:d.java

示例11: onReceivedError

import android.webkit.WebView; //导入方法依赖的package包/类
public void onReceivedError(WebView webView, int i, String str, String str2) {
    webView.stopLoading();
    AuthorizeListener authorizeListener = this.a.a().getAuthorizeListener();
    this.a.finish();
    if (authorizeListener != null) {
        authorizeListener.onError(new Throwable(str + " (" + i + "): " + str2));
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:b.java

示例12: onReceivedError

import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public void onReceivedError(WebView view, int errorCode, String description, String url) {
    Log.d(TAG, "onReceivedError() called with: view = [" + view + "], errorCode = ["
            + errorCode + "], description = [" + description + "], url = [" + url +
            "]");
    isError = true;
    if (view != null) {
        view.stopLoading();
        view.setVisibility(View.GONE);//NullPointerException
    }
    mErrorView.setVisibility(View.VISIBLE);
}
 
开发者ID:fendoudebb,项目名称:PlayAndroid,代码行数:13,代码来源:WebViewActivity.java

示例13: receiveCommand

import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public void receiveCommand(WebView root, int commandId, @Nullable ReadableArray args) {
  switch (commandId) {
    case COMMAND_GO_BACK:
      root.goBack();
      break;
    case COMMAND_GO_FORWARD:
      root.goForward();
      break;
    case COMMAND_RELOAD:
      root.reload();
      break;
    case COMMAND_STOP_LOADING:
      root.stopLoading();
      break;
    case COMMAND_POST_MESSAGE:
      try {
        JSONObject eventInitDict = new JSONObject();
        eventInitDict.put("data", args.getString(0));
        root.loadUrl("javascript:(function () {" +
          "var event;" +
          "var data = " + eventInitDict.toString() + ";" +
          "try {" +
            "event = new MessageEvent('message', data);" +
          "} catch (e) {" +
            "event = document.createEvent('MessageEvent');" +
            "event.initMessageEvent('message', true, true, data.data, data.origin, data.lastEventId, data.source);" +
          "}" +
          "document.dispatchEvent(event);" +
        "})();");
      } catch (JSONException e) {
        throw new RuntimeException(e);
      }
      break;
    case COMMAND_INJECT_JAVASCRIPT:
      root.loadUrl("javascript:" + args.getString(0));
      break;
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:40,代码来源:ReactWebViewManager.java

示例14: hideWebview

import android.webkit.WebView; //导入方法依赖的package包/类
/**
 * Stop navigation, close webview and refresh toolbar
 */
private void hideWebview() {
    WebView webview = (WebView)findViewById(R.id.webview);
    webview.stopLoading();
    webview.getSettings().setJavaScriptEnabled(false);
    webview.setVisibility(View.GONE);
    isWebviewOpen = false;
    getSupportActionBar().setSubtitle(R.string.account_activity_choose_subtitle);
    invalidateOptionsMenu();
}
 
开发者ID:nioc,项目名称:tumblr-photo-browse,代码行数:13,代码来源:AccountActivity.java


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