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