title: ConnectivityManager is crashing while getting network info
body: <p>I am new to Android and when I give the following snippet, my Android application is crashing.</p>
  
  <pre><code>ConnectivityManager manager = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
  manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); // Application is crashing in this line.
  </code></pre>
  
  <p>I also checked the <em>AndroidManifest.xml</em> where I gave the Internet permission to the application. Any help would be really useful for my further work.</p>