GetSystemService(ConnectivityService) returns null when trying to check internet connection Xamarin.android
<p>I am making an Android application using Xamarin.Android and using the following tutorial provided by Xamarin to check if there is internet connection available: <a href="https://developer.xamarin.com/recipes/android/networking/networkinfo/detect_network_connection/" rel="nofollow">https://developer.xamarin.com/recipes/android/networking/networkinfo/detect_network_connection/</a></p>

<p>In the first part of the tutorial I need to create a Connectivity manager object and use GetSystemService to initialize it.</p>

<p>Here is the line of code:</p>

<pre><code>connectivityManager = (ConnectivityManager)GetSystemService(ConnectivityService);
</code></pre>

<p>When I run the application an exception get thrown of type System.NullReferenceException. And the message states: Object reference not set to an instance of an object. </p>