Can't get location on android device
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/10443577/get-current-location-in-android">get current location in android</a>  </p>
</blockquote>



<p>I'm trying to make an application for android that gives me the position of the device.
I'm using the LocationManager.requestlocationupdates method to start a listener.
Unfortunately this doesn't work. When I'm looking for the stacktrace in Logcat I don't find any error but one sentence.</p>

<blockquote>
  <p>11-28 12:01:17.377: E/AndroidRuntime(1138):   at 
  Tom.Tracer.App.GetCoords.run(GetCoords.java:28)</p>
</blockquote>

<p>This line doesn't really help me further..</p>

<p>I'm using this code :</p>

<pre><code>@Override
public void run() {
     lm = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE) ;
     lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 10, locationListener) ; 


}
</code></pre>

<p>The Listener </p>

<pre><code>private final LocationListener locationListener = new LocationListener() {
    public void onLocationChanged(Location location) {
        double longitude = location.getLongitude();
        double latitude = location.getLatitude();
        Date date = new Date(); 
        toSave = "NEW" + date.toString()+ "-" + location.getLatitude() + "-" + location.getLongitude() + "/";
        p("To save: " + toSave); 

        }
};
</code></pre>

<p>Thanks for your help!</p>
