tags:

views:

46

answers:

1

I have an application with a map and an ItemizedOverlay, and need to determine if the user is within a certain distance of a GeoPoint on the ItemizedOverlay. If thats the case then start a new Activity..

How do I approach this?

A: 

It sounds like you have various things you need to do, I would break it down into the following

  1. Obtain the users GeoPoint, have a look at this API it might be useful
  2. Determine the distance between the users GeoPoint and any other given GeoPoint, I found this article which explains how to calculate distances, its worth a read
  3. If the distance meets a particular requirement, then start a new activity, for this I would suggest to read up on Intents/Lifecycle. You could create a new intent and use startActivity(intent); which would start another activity, you can read more here
James.Elsey
Don't calculate the distance yourself use the functions that are available in the location class: http://developer.android.com/reference/android/location/Location.html
Janusz
Thanks alot.. Think I got it now :)
lasse