Hi, I'm trying to start a GPS program and I'm just trying out the first step to display coordinates as they change.
I followed http://www.devx.com/wireless/Article/39239 and used the LocationManager and LocationListener classes. Code: public class GPSTest extends Activity { /** Called when the activity is first created. */ private TextView text; private LocationManager manager; private LocationListener listener; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); text = (TextView) findViewById(R.id.Text); manager = (LocationManager) getSystemService (Context.LOCATION_SERVICE); listener = new MyLocationListener(); manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, listener); } private class MyLocationListener implements LocationListener{ public void onLocationChanged(Location location) { // TODO Auto-generated method stub if (location != null){ text.setText(text.getText() + "\n" + location.getLatitude() + ", " + location.getLongitude() + " - " + location.getAccuracy()); } } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } } } However, once I run the code on the phone, the GPS icon is seen flashing but nothing happens. The method onLocationChanged is never reached (according to breakpoints). What am I doing wrong? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---