本文整理汇总了C#中WebView.RestoreState方法的典型用法代码示例。如果您正苦于以下问题:C# WebView.RestoreState方法的具体用法?C# WebView.RestoreState怎么用?C# WebView.RestoreState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebView
的用法示例。
在下文中一共展示了WebView.RestoreState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
//
// Load the state either from a configuration change or from the intent.
//
state = LastNonConfigurationInstance as State;
if (state == null && Intent.HasExtra ("StateKey")) {
var stateKey = Intent.GetStringExtra ("StateKey");
state = StateRepo.Remove (stateKey);
}
if (state == null) {
Finish ();
return;
}
Title = state.Authenticator.Title;
//
// Watch for completion
//
state.Authenticator.Completed += (s, e) => {
SetResult (e.IsAuthenticated ? Result.Ok : Result.Canceled);
Finish ();
};
state.Authenticator.Error += (s, e) => {
if (e.Exception != null) {
this.ShowError ("Authentication Error", e.Exception);
}
else {
this.ShowError ("Authentication Error", e.Message);
}
BeginLoadingInitialUrl ();
};
//
// Build the UI
//
webView = new WebView (this) {
Id = 42,
};
webView.Settings.JavaScriptEnabled = true;
webView.SetWebViewClient (new Client (this));
SetContentView (webView);
//
// Restore the UI state or start over
//
if (savedInstanceState != null) {
webView.RestoreState (savedInstanceState);
}
else {
BeginLoadingInitialUrl ();
}
}