Okay. Maybe I am missing something here but AFAIK the if statement check to
see that location is not equal to null and if that is true (location not
being null)
it passes it on to the Overlay.

Did I get that right?

On Thu, Jul 7, 2011 at 11:36 PM, Mark Murphy <[email protected]>wrote:

> On Thu, Jul 7, 2011 at 2:00 PM, Raghav Sood <[email protected]> wrote:
> > But the thing is location can't be null. If it was the app wouldn't have
> > reached here. I check for location being null in my main activity:
> >
> > if (location != null) {
> >
> >          // Update my location marker
> >
> >         positionOverlay.setLocation(location);
> >
> > Only the does MyPositionOverlay receive location.
>
> As I indicated in your previous thread, if you try to use the overlay
> and YOU HAVE NOT RECEIVED A LOCATION YET (caps to ensure you pay
> attention), your location variable will be null simply because you
> haven't ever had any valid Location to use.
>
> So, as I wrote before, you either need to not set up the overlay until
> you actually have a Location, or you need to have more smarts in the
> overlay to deal with the null location case.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training...At Your Office: http://commonsware.com/training
>
> --
> 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
>



-- 
Raghav Sood
http://www.raghavsood.com/
http://wiki.androidappcheck.com/
http://www.telstop.tel/
https://market.android.com/developer?pub=Raghav+Sood

-- 
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

Reply via email to