Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 15th, 2012  |  syntax: None  |  size: 0.83 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Blackberry OS6: implementing click event on extended MapLocation class
  2. import net.rim.device.api.lbs.maps.model.MapLocation;
  3. import net.rim.device.api.ui.component.Dialog;
  4.  
  5. public class CustomMapLocation extends MapLocation {
  6.  
  7.     private Partner partner;
  8.  
  9.     public KRMapLocation(double lat, double lon, String label, String address) {
  10.          setLat(lat);
  11.          setLon(lon);
  12.          setName(label);
  13.          setDescription(address);
  14.     }
  15.  
  16.     public KRMapLocation(Partner p) {
  17.         this.partner = p;
  18.         setLat(partner.getLatitude());
  19.         setLon(partner.getLongitude());
  20.         setName(partner.getName());
  21.         setDescription(partner.getAddress());
  22.     }
  23.  
  24.     // this does nothing...
  25.     protected boolean trackwheelClick(int status, int time) {
  26.         Dialog.alert("Trackwheel click");
  27.         return true;
  28.     }
  29.  
  30. }