handleMessage not called
<p>I have a thread that attempts to get the user location.</p>

<p>When the location is received "handler.sendMessage(msg)" is called, and it returns true, but handleMessage is never called.</p>

<p>There are no errors or warnings in logcat.</p>

<p>The code:</p>

<pre><code>public class LocationThread extends Thread implements LocationListener {
    // ... Other (non-relevant) methods

    @Override
    public void run() {
        super.run();

        Looper.prepare();
        mainHandler = new Handler(Looper.myLooper()) {
            @Override
            public void handleMessage(Message msg) {
                // This method is never called
            }
        };
        locationManager.requestLocationUpdates(
                LocationManager.NETWORK_PROVIDER, 0, 0, this);
        Looper.loop();
    }

    @Override
    public void onLocationChanged(Location location) {
        // SendMessage is executed and returns true
        mainHandler.sendMessage(msg);
        if (mainHandler != null) {
            mainHandler.getLooper().quit();
        }
        locationManager.removeUpdates(this);
    }
}
</code></pre>
