Locationlistener and Timers
<p>Does anyone know why i'm not able to get any coordinates when registeren a locationlistener via a Timertask (tried both NETWORK_PROVIDER and GPS_PROVIDER)
but when i register them manually i get coordinates just fine. </p>

<p>this is how i register my listener:</p>

<pre><code>Looper.myLooper().prepare();
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,locationListener);
Looper.myLooper().loop();
</code></pre>

<p>my location listener looks like this:</p>

<pre><code>LocationListener locationListener = new LocationListener() {

    public void onLocationChanged(Location location) {
        lat = location.getLatitude();
        longt = location.getLongitude();
        if(lat !=0 &amp;&amp; longt!=0)
        {Log.e(LOG_TAG, "getting coords");
            locationManager.removeUpdates(locationListener);
            Toast.makeText(getApplicationContext(), "got coords!!!", 2000).show();
            reqlat.add(String.valueOf(lat));
            reqlon.add(String.valueOf(longt));
            DateFormat timeformat = new SimpleDateFormat("HH:mm:ss");
            Date now = new Date();
            Date date = new Date();
            DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
            reqtime.add(String.valueOf(timeformat.format(now)));
            reqdate.add(String.valueOf(dateFormat.format(date)));  
            savemyData();
            lastlongt = longt;
            lastlat = lat;
            logging=false;
            coords = false;
            CancelGpsTimer();
            Looper.myLooper().quit();

        }

    }
</code></pre>

<p>i suspect it has something to do with the looper.prepare() but i can't figure out what. If i don't have a looper.prepare() i get an exception saying i can't create a handler insisde a thread that has not called looper.prepare().</p>
