Code example for Activity

0
  private MotionEvent sourceEvent;
  private MyOnTouchListener mapTouchListener;
 
 
  @Before public void setUp() throws Exception { 
    mapView = new MapView(new Activity(), "foo");
 
    overlay1 = new MyOverlay();
    overlay2 = new MyOverlay();
    mapTouchListener = new MyOnTouchListener();
 
    mapView.getOverlays().add(overlay1);
    mapView.getOverlays().add(overlay2);
    mapView.setOnTouchListener(mapTouchListener);
 
    sourceEvent = MotionEvent.obtain(0, 0, 0, 0, 0, 0);
  } 
 
  @Ignore("not yet working in 2.0, sorry :-(") // todo 2.0-cleanup 
  @Test 
  public void shouldDispatchTouchEventsToOverlays() throws Exception {