I am still kinda new to android programming, and am running into an issue with the “requestLocationUpdates”. I am pretty sure I have narrowed it down, to this, because my code works when I comment it out. What happens is when I run it with the code as written below, the program just stops responding. I am using android 2.2, with permissions set to 1.6. I know 2.3 was causing issues, but it sounded like 2.2 should be fine. I just included what I think was important in my code below, if other parts are need let me know.
locman= (locationManager) getSystemService(Context.LOCATION_SERVICE);
locman.requestLocationUpdates(LocationManger.GPS_PROVIDER, 0,0, new locationListener());
}
private class locationListener implements LocationListener
{
@Override
public void onLocationChanged(Location loc)
{
if (loc !=null) {
Toast.makeText(getBaseContext(), "Location Changed: Lat: " + loc.getLatitude() + "Lng: " + loc.getLongitud(), Toast.LENGTH_SHORT).show();
}
gp= new GeoPoint(
(int) (loc.getLatitude()*1E6),(int) (loc.getLongitude()*1E6));
well it was a stupid mistake, on the manifest.xml file I spelled ACCESS with an extra S so it was ACCESSS. Obviously does not work very well. I hate spelling errors! I figured it out, by adding COARSE_LOCATION, and realizing that FINE and COARSE did not line up correctly like they should.