title: How to create a Context Menu on a MapView?
body: <p>I would like to have a Context Menu on my <code>MapView</code> and let the user choose between a map or a satellite photo in the background. I have tried to create a Context Menu by following <a href="http://developer.android.com/guide/topics/ui/menus.html" rel="nofollow">Creating Menus</a> but it doesn't work for me.</p>
  
  <p>The application works but no Context Menu is shown. How can I create a Context Menu on my <code>MapView</code>?</p>
  
  <p>In my <code>onCreate()</code> I have this code:</p>
  
  <pre><code>    MapView mapView = (MapView) findViewById(R.id.mapview);
      registerForContextMenu(mapView);
  </code></pre>
  
  <p>And I have overrided some methods:</p>
  
  <pre><code>@Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo info) {
      super.onCreateContextMenu(menu, v, info);
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.context_menu, menu);
  }
  
  @Override
  public boolean onContextItemSelected(MenuItem item) {
      AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
      switch (item.getItemId()) {
      case R.id.map_view_item: 
          return true;
      case R.id.satellite_item: 
          return true;
      default: return super.onContextItemSelected(item);
      }
  }
  </code></pre>