Infinite broadcast while location change
<p>I have make a function in activity</p>

<pre><code>if (locationManager != null &amp;&amp; pendingIntent != null) {
   locationManager.removeUpdates(pendingIntent);
}
Intent intent = new Intent("com.app.android.tracker.LOCATION_READY");
pendingIntent = PendingIntent.getBroadcast(getApplicationContext(),
            0, intent, PendingIntent.FLAG_UPDATE_CURRENT);

//Register for broadcast intents
locationManager.requestLocationUpdates(provider,120000,0,pendingIntent); }
</code></pre>

<p>and in broadcast receive I have do</p>

<pre><code>public class LocationReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {

        Logger.debug("LocationReceiver-&gt;onRceive");
        Bundle b = intent.getExtras();
        Location loc = (Location)b.get(android.location.LocationManager.KEY_LOCATION_CHANGED);
        Logger.debug("Loc:"+loc);
        if(loc != null){
            //
        }
    } }
</code></pre>

<p>and in manifest I have do</p>

<pre><code>&lt;receiver android:name=".LocationReceiver"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.app.android.tracker.LOCATION_READY" /&gt;
                &lt;category android:name="android.intent.category.DEFAULT" /&gt;
            &lt;/intent-filter&gt; 
&lt;/receiver&gt;
</code></pre>

<p>now my problem is while any location is update It do infinitely broadcast n my emulator is hang.
and some time it gives null location </p>
