Wrox Programmer Forums
|
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2010, 12:53 AM
Registered User
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple Overlays Question

Hi,

I haven't been able to achieve 1 action for a user clicking an OverlayItem and 1 action for a user clicking an empty location on the map.


I can't seem to get

@Override
public boolean onTap(GeoPoint point, MapView mapView){ Toast.makeText(TaskMapView.this, "boo", Toast.LENGTH_SHORT).show(); return false;}

To fire when

@Override
protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index);
if(item != null){
AlertDialog.Builder dialog = new AlertDialog.Builder(TaskMapView.this);
dialog.setTitle(item.getTitle());
dialog.setMessage(item.getSnippet());
dialog.show();
return true;
}
return false;}


is active.

I tried using 2 overlays, changing the true/false of the return values to various combinations but the best I could get is 1 Itemizedoverlay firing for the protected onTap and one Overlay (plain) firing for the map click.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple select box question cstooch Classic ASP Professional 5 December 10th, 2007 06:56 PM
Importing Multiple files in Multiple tables Versi Suomi Access 6 June 1st, 2005 08:47 AM
Multiple ADO multiple user login Oracle9i jhay0721 Pro VB Databases 1 April 4th, 2005 11:23 AM
Multiple Joins in Multiple Table Search query pookster Access 4 September 23rd, 2004 03:04 PM
Updating multiple Rows from multiple fields in ASP vdm_nana SQL Server ASP 0 April 1st, 2004 04:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.