Hi,
I am facing a small Problem with GPS data. my activity is not updating the
location whenever it changes.
Here is the code
public class MapTabView extends MapActivity {
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.maptabview);
MapView view = (MapView) findViewById(R.id.mapview);
view.setBuiltInZoomControls(true);
final MapController control = view.getController();
LocationManager manager =
(LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
LocationListener locationListener = new LocationListener(){
@Override
public void onLocationChanged(Location location) {
control.setCenter(new
GeoPoint((int)location.getLatitude(),(int)location.getLongitude()));
}
@Override
public void onStatusChanged(String provider, int status,
Bundle extras) {
}};
manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
locationListener);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
Any Help please
--
Musaddaq
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en