Hi,

I'm copying the MyLocationOverlay class, because it is missing something
important to my application. So I decided to reimplement it myself.
I have everything working, except the animation of the dot.

Here's what I have:

this is from my new "MyLocationOverlay" class

public MyPositionOverlay(Context ctx, MapView mapView) {
     gpsLocationImage = (AnimationDrawable)
ctx.getResources().getDrawable(R.anim.gps_fix);
     netLocationImage = (AnimationDrawable)
ctx.getResources().getDrawable(R.anim.network_fix);
}

public void draw(Canvas canvas, MapView mapView, boolean shadow) {
     /* Some code here */

    Drawable d = GlobalVars.positioner.isGPSFix() ?
gpsLocationImage.getCurrent() : netLocationImage.getCurrent();

     /* Some other code here */

     d.draw(canvas);
     super.draw(canvas, mapView, shadow);
}


then, in my mapview's onWindowFocusChanged i have this:

 @Override public void onWindowFocusChanged(boolean hasFocus) {
AnimationDrawable l = myPositionOverlay.getLocationDotDrawable();
                if (hasFocus) l.start(); else l.stop();
super.onWindowFocusChanged(hasFocus);
}


What am I doing wrong to only get the first frame on screen?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to