Android unregisterReceiver with onPause
<p>I have something like this in my manifest file - I need one receiver for the situation that a power source was connected and the other receiver for unplugged source.</p>

<pre><code>&lt;receiver android:name=".PowerConnectionOnReceiver" &gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.ACTION_POWER_CONNECTED" /&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;
            &lt;receiver android:name=".PowerConnectionOffReceiver" &gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;
</code></pre>

<p>But I want to unregisterReceiver, when onPause is called in my MainActivity. How to do it?</p>
