Megha.....thanks.

Is there any sample code for handling Overlays in the new SDK?
I previously used OverlayController, which is now gone.  I now add my
QuesterOverlay (extends Overlay) as follows:

        QuesterOverlay qOverlay = new QuesterOverlay(this,
_mapView);
        List<Overlay> overlays = _mapView.getOverlays();
        overlays.add(qOverlay);
        _mapView.postInvalidate();

Later, when I want qOverlay to (re)draw, I invoke

        mapUpdateHandler.sendEmptyMessage(NEED_MAP_UPDATE);

where mapUpdateHandler is defined by:

private Handler mapUpdateHandler
        = new Handler()  {
                        public void handleMessage(Message msg) {
                             switch (msg.what) {
                                  case Quester.NEED_MAP_UPDATE:
                                       // We identified the Message by its 
what-ID
                                       if (running) {
                                            // New data loaded; clear the old
overlay and display the new:
                                           _mapView.invalidate();
                                       }
                                       break;
                             }
                             super.handleMessage(msg);
                        }
                    };

_mapView.invalidate() is clearly called  -- the handset screen becomes
a nice light blue, and stays that way.
The code in qOverlay is not invoked -- I have a breakpoint right
inside the draw code (on super):

   public synchronized void draw(Canvas canvas, boolean b)
    {
        super.draw(canvas, mapView, b);
         .......etc......

but we never get there.

Hopefully a working example will help me sort it out.

Thanks,
Ken

On Sep 5, 8:49 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> 2008/9/5 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
>
>
> > Great!  That brings up the map.
> > Should all of my uses-permision tags be above the <application> tag??
>
> They should be outside the application tag and inside manifest tag. The
> AndroidManifest editor adds them below the application tag.
>
>
>
> > --Ken
>
> > On Sep 5, 7:24 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> > > Add  <uses-permission android:name="android.permission.INTERNET" /> above
> > > the <application> tag.
>
> > > 2008/9/5 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> > > > Ok, that makes a /major/ difference:
> > > > The app actually gets started, and a centerpoint for the map appears.
> > > > However, no map actually is shown.  A diagonal crosshatch is there,
> > > > but nothing else.
>
> > > > The app has some key responses dispatched by onKeyDown and these
> > > > appear to basically be working correctly.
>
> > > > So I need to be able to figure out what's happened to maps (between m5
> > > > & now).
>
> > > > Thanks much.
> > > > Ken
>
> > > > On Sep 5, 6:39 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > > > [EMAIL PROTECTED] wrote:
> > > > > > A)  I tried adding (no luck) the following for the <uses-library>
> > > > > > tag.  Is this anywhere near correct?
>
> > > > > > <uses-library>com.google.android.maps</uses-library>
>
> > > > > Try:
>
> > > > > <uses-library android:name="com.google.android.maps" />
>
> > > > > It should appear inside your <application> element.
>
> > > > > --
> > > > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > > > Warescription: All titles, revisions, & ebook formats, just $35/year
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to