本文整理了Java中android.webkit.WebView.stopLoading()
方法的一些代码示例,展示了WebView.stopLoading()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.stopLoading()
方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:stopLoading
暂无
代码示例来源:origin: Rukey7/MvpApp
@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;
}
代码示例来源:origin: facebook/facebook-android-sdk
@Override
public void dismiss() {
if (webView != null) {
webView.stopLoading();
}
if (!isDetached) {
if (spinner != null && spinner.isShowing()) {
spinner.dismiss();
}
}
super.dismiss();
}
代码示例来源:origin: Justson/AgentWeb
@Override
public void stopLoading() {
if (!AgentWebUtils.isUIThread()) {
mHandler.post(new Runnable() {
@Override
public void run() {
stopLoading();
}
});
return;
}
this.mWebView.stopLoading();
}
代码示例来源:origin: ankidroid/Anki-Android
private void destroyWebView(WebView webView) {
if (webView != null) {
webView.stopLoading();
webView.setWebChromeClient(null);
webView.setWebViewClient(null);
webView.destroy();
}
}
代码示例来源:origin: commonsguy/cw-omnibus
void loadUrl(String url) {
android.util.Log.d(getClass().getSimpleName(), url);
getWebView().stopLoading();
getWebView().loadUrl(url);
}
代码示例来源: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: cSploit/android
@Override
public void onBackPressed() {
if (mWebView != null && mWebView.canGoBack())
mWebView.goBack();
else {
if (mWebView != null)
mWebView.stopLoading();
super.onBackPressed();
overridePendingTransition(R.anim.fadeout, R.anim.fadein);
}
}
}
代码示例来源:origin: stackoverflow.com
@Override
public void onLoadResource (WebView view, String url) {
if (url.contains("googleads")) {
if(view.getHitTestResult().getType() > 0){
view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
view.stopLoading();
Log.i("RESLOAD", Uri.parse(url).toString());
}
}
}
代码示例来源:origin: syncthing/syncthing-android
@Override
public void onServiceStateChange(SyncthingService.State newState) {
Log.v(TAG, "onServiceStateChange(" + newState + ")");
if (newState == SyncthingService.State.ACTIVE) {
if (mWebView == null) {
Log.v(TAG, "onWebGuiAvailable: Skipped event due to mWebView == null");
return;
}
if (mWebView.getUrl() == null) {
mWebView.stopLoading();
setWebViewProxy(mWebView.getContext().getApplicationContext(), "", 0, "localhost|0.0.0.0|127.*|[::1]");
mWebView.loadUrl(getService().getWebGuiUrl().toString());
}
}
}
代码示例来源:origin: adblockplus/libadblockplus-android
@Override
public void stopLoading()
{
stopAbpLoading();
super.stopLoading();
}
代码示例来源:origin: zhangxieliu/NewsClient
@Override
protected void onStop() {
super.onStop();
webView.stopLoading();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
webView.onPause(); // 暂停网页中正在播放的视频
}
}
代码示例来源:origin: andforce/iBeebo
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mWebView.stopLoading();
finish();
}
});
代码示例来源:origin: msdx/status-bar-compat
@Override
protected void onDestroy() {
webView.stopLoading();
webView.destroy();
super.onDestroy();
}
}
代码示例来源:origin: CityZenApp/Android-Development
@Override
public void onStop() {
super.onStop();
webView.stopLoading();
}
代码示例来源:origin: envyfan/AndroidReview
@Override
protected void onDestroy() {
super.onDestroy();
if (mWebView != null) {
mWebView.stopLoading();
mWebView.setWebChromeClient(null);
mWebView.setWebViewClient(null);
mWebView.destroy();
mWebView = null;
}
}
}
代码示例来源:origin: andforce/iBeebo
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
showProgress();
if (url.startsWith(SeniorUrl.SeniorUrl_Public)) {
view.stopLoading();
handleRedirectUrl(view, url, JSWebViewActivity.this);
return;
}
super.onPageStarted(view, url, favicon);
}
代码示例来源:origin: braintree/braintree_android
public void onPageStarted(WebView view, String url, Bitmap icon) {
if (url.contains("html/authentication_complete_frame")) {
view.stopLoading();
String authResponseJson = Uri.parse(url).getQueryParameter("auth_response");
mActivity.finishWithResult(
ThreeDSecureAuthenticationResponse.fromJson(authResponseJson));
} else {
super.onPageStarted(view, url, icon);
}
}
代码示例来源:origin: behindeye/WxPhoneNumberHelper
@Override
public void onBackPressed() {
if (mWebView.canGoBack()) {
mWebView.goBack();
}else{
mWebView.stopLoading();
finish();
}
}
}
代码示例来源:origin: braintree/braintree_android
@Test
public void onReceivedSslError_callsFinish() {
SslErrorHandler handler = mock(SslErrorHandler.class);
mWebViewClient.onReceivedSslError(mWebView, handler, mock(SslError.class));
verify(mWebView, times(1)).stopLoading();
verify(handler, times(1)).cancel();
verify(mActivity, times(1)).finishWithResult(any(ThreeDSecureAuthenticationResponse.class));
}
}
内容来源于网络,如有侵权,请联系作者删除!