Exemplo n.º 1
0
  public boolean onPrepareOptionsMenu(
      final Menu pMenu, final int menuIdOffset, final MapView mapView) {
    for (final Overlay overlay : this.overlaysReversed()) {
      if (overlay instanceof IOverlayMenuProvider) {
        final IOverlayMenuProvider overlayMenuProvider = (IOverlayMenuProvider) overlay;
        if (overlayMenuProvider.isOptionsMenuEnabled()) {
          overlayMenuProvider.onPrepareOptionsMenu(pMenu, menuIdOffset, mapView);
        }
      }
    }

    if (mTilesOverlay != null && mTilesOverlay.isOptionsMenuEnabled()) {
      mTilesOverlay.onPrepareOptionsMenu(pMenu, menuIdOffset, mapView);
    }

    return true;
  }
Exemplo n.º 2
0
  public boolean onOptionsItemSelected(
      final MenuItem item, final int menuIdOffset, final MapView mapView) {
    for (final Overlay overlay : this.overlaysReversed()) {
      if (overlay instanceof IOverlayMenuProvider) {
        final IOverlayMenuProvider overlayMenuProvider = (IOverlayMenuProvider) overlay;
        if (overlayMenuProvider.isOptionsMenuEnabled()
            && overlayMenuProvider.onOptionsItemSelected(item, menuIdOffset, mapView)) {
          return true;
        }
      }
    }

    if (mTilesOverlay != null
        && mTilesOverlay.isOptionsMenuEnabled()
        && mTilesOverlay.onOptionsItemSelected(item, menuIdOffset, mapView)) {
      return true;
    }

    return false;
  }