本文整理汇总了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;
}
示例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();
}
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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;
}
示例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));
}
}
示例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);
}
示例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;
}
}
示例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();
}