In response to a question in the forum, “WebView” get into the following error when I want to run the example.
LOG:
Preview detected an unhandled exception: Uno.Exception: A rootview is already set
at Fuse.Android.RootView.SetRoot(Fuse.Android.NativeViews.NativeView)
at Fuse.Android.NativeViews.NativeView.RootNativeView()
at Fuse.Android.NativeViews.NativeView.OnRooted(Fuse.Node)
at Fuse.Android.NativeViews.ParentNativeView`1.OnRooted(Fuse.Node)
at Fuse.Behavior.Rooted(Fuse.Node)
at Fuse.Node.RootBehaviors()
at Fuse.Node.MarkRooted()
at Fuse.Node.OnAdded(Fuse.Node)
at Fuse.RootViewport.set_Content(Fuse.Node)
at Fuse.App.OnSetTheme(Fuse.Theme)
at Fuse.AppBase.CheckPendingReify()
at Fuse.AppBase.OnUpdate()
at Outracks.Simulator.Application.OnUpdate()
at Fuse.App.FrameCallback.doFrame(long)
LOG: A rootview is already set
Sample Code (from fuse learn)
<App Theme="Native" Background="#333">
<JavaScript>
module.exports = {
onPageLoaded : function(res) {
console.log("WebView arrived at "+ JSON.parse(res.json).url);
}
};
</JavaScript>
<DockPanel>
<StatusBarBackground Dock="Top"/>
<NativeViewHost>
<WebView Dock="Fill" Url="http://www.google.com">
<PageLoaded>
<EvaluateJS Handler="{onPageLoaded}">
var result = {
url : document.location.href
};
return result;
</EvaluateJS>
</PageLoaded>
</WebView>
</NativeViewHost>
<BottomBarBackground Dock="Bottom" />
</DockPanel>
</App>