On Sat, Dec 4, 2010 at 9:43 AM, cool.manish <[email protected]> wrote: > I am displaying google map in my app and displaying POIs on it using > overlay. I want to capture onTap action of the overaly and to move to > another activity. I have find out some tutorial which are telling how > to display some message at the time of clicking but I want to move to > another activity. Now problem is this that overlay class doesn't have > context object then how will I start another activity.
Step #1: Pass a Context object (e.g., the MapActivity) into your overlay's constructor. Step #2: Hold onto that Context object via a private data member in your overlay, using a Java assignment statement in your constructor (e.g., this.ctxt=ctxt;). Step #3: Use that Context object for your startActivity() call. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.3 Available! -- 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

