Nullpointerexception getSystemService
<p>Following line will only not result in a nullpointer exception if I'm connected to a WLAN:</p>

<pre><code>ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
</code></pre>

<p>Otherwise I get a nullpointer-exception straight ahead? How can I fix this? I want my background service to only work, when it is connected to wlan. But that Nullpointerexception just kills the whole app...</p>
