registerReceiver for Broadcast only if it's not already registered?
<p>I have a snippet of code that I'm calling from a service:</p>

<pre><code>context.registerReceiver(new BroadcastReceiver() {

    @Override
    public void onReceive(Context context, Intent intent) {
        try {
            WifiManager mWm = (WifiManager) context
                    .getSystemService(Context.WIFI_SERVICE);
            ret = mWm.isWifiEnabled();
            // DO MORE STUFF HERE
        } catch (Exception e) {
        }
    }
}, new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));
</code></pre>

<p>What I would like is a way to check and make sure that the <code>registerReceiver</code> isn't already listening before it calls it again.  Is this possible?</p>

<p>For example if my snippet of code is in a method, and I call the method 10 times, right now the <code>onReceive</code> method appears to run 10 times.</p>
