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


C# WebView.ClearCache方法代码示例

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


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

示例1: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			
			ViewGroup root = (ViewGroup)inflater.Inflate (Resource.Layout.fragment_webview_with_spinner, null);

			// For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
			// FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
			root.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
	
			loadingSpinner = root.FindViewById (Resource.Id.loading_spinner);
			webView = root.FindViewById<WebView> (Resource.Id.webview);
			webView.SetWebChromeClient (webChromeClient);
			webView.SetWebViewClient (webViewClient);
	
			webView.Post (() => {
				if (CLEAR_CACHE_ON_LOAD) {
					webView.ClearCache (true);	
				}
				webView.Settings.JavaScriptEnabled = true;
				webView.Settings.JavaScriptCanOpenWindowsAutomatically = false;
				webView.LoadUrl (MAP_URL);
				webView.AddJavascriptInterface (new MyMapJsi (Activity, savedInstanceState), MAP_JSI_NAME);
			});
			
			return root;
			
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:27,代码来源:MapFragment.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.dropboxAuthorization);

            // For adding webview js must be enabled and add INTERNET permission to AndroidManifest xml
            _web = this.FindViewById<WebView>(Resource.Id.webViewBox);
            _web.Settings.JavaScriptEnabled = true;
            _web.Settings.JavaScriptCanOpenWindowsAutomatically = true;
            _web.Settings.SetSupportZoom(false);
            _web.SetScrollContainer(true);
            _web.SetNetworkAvailable(true);

            _webClient = new DropboxAuthizationWebviewClient();
            _webClient._authorization = this;

            _web.ClearCache(true);
            _web.ClearHistory();
            _web.ClearFormData();
            clearCacheFolder(this.CacheDir);
            this.DeleteDatabase("webview.db");
            this.DeleteDatabase("webviewCache.db");

            var _url = DropboxHelper.GetInstance().GetAuthorizationURL();
            if (_url.Contains("connect_login"))
            {
                _url = _url.Replace("connect_login", "logout");
            }
            else
            {
                _url = "https://www.dropbox.com/logout?cont=" + System.Web.HttpUtility.UrlEncode(_url); //_url.Replace(":", "%3A").Replace("?","%3D");
            }

            _web.LoadUrl(_url);

            _web.SetWebViewClient(_webClient);

            var button = this.FindViewById<Button>(Resource.Id.testbutton);
            button.Click += button_Click;
        }
开发者ID:CarolineCao,项目名称:example_timePilot,代码行数:40,代码来源:dropboxAuthorizationActivity.cs


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