'Xamarin WebView - Object reference not set to an instance of an Object C#
I have two pages with WebViews. Both pages are identical. The first page works perfectly. I cloned it to create the second and replicated the code by just changing the names of the variables and webviews. So Code is the same. Here's one of the webviews. All of them give the same error.
Whenever I access the second page on the android app I get the following error on:
OneWebView.Source = new HtmlWebViewSource
{ Html = "<p>some HTML string</p>" };
<WebView
x:Name="OneWebView"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
/>
When trying to define values to OneWebView.Source I get > "Object reference not set to an instance of an Object"
Solution 1:[1]
Solved
I have forgot to initialize
public Page()
{
InitializeComponent();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nopnahnah |
