runOnFirstFix is not executed

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

runOnFirstFix is not executed

Postby afail » Sun Oct 10, 2010 9:16 am

Hi,

I try to get the current location of the user using MyLocationOverlay, the conventional way (as specified in the ref.):

Code: Select all
myLocationOverlay = new MyLocationOverlay(this, mapView);
        mapView.getOverlays().add(myLocationOverlay);
        myLocationOverlay.enableMyLocation();
        myLocationOverlay.runOnFirstFix(new Runnable() {
            public void run() {
                Log.v("MYLOCATION TO STRING: ", myLocationOverlay.getMyLocation().toString());
                Toast.makeText(getApplicationContext(), myLocationOverlay.getMyLocation().toString(), Toast.LENGTH_SHORT).show();
                mapController.animateTo(myLocationOverlay.getMyLocation());
            }
        });


But the loop does not enter runOnFirstFix never!
I tried logging, putting a Toast and even debugging, the debugger skips the method as it gets to it (does not enter it). The map always locates at Tulsa/USA (and I am in far-away Europe) :) Probably the default location if none is defined/found...

I am using my PC, not a phone device, with an AVD.
afail
Developer
Developer
 
Posts: 31
Joined: Sat Oct 02, 2010 8:43 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 7 guests