public class Testdb7 extends MapActivity {
 private MapView map=null;
 private MyLocationOverlay me=null;
 private static final int LIST_ID = Menu.FIRST+1; 
 private static final int SEARCH_ID = Menu.FIRST+2;
 private static final int ADD_ID = Menu.FIRST+3;
 
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  
  
  
  map=(MapView)findViewById(R.id.map);  
  map.getController().setCenter(getPoint(40.76793169992044, -73.98180484771729));
  map.getController().setZoom(17);  
  ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom);  
  zoom.addView(map.getZoomControls());  
  Drawable marker=getResources().getDrawable(R.drawable.marker);  
  marker.setBounds(0, 0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight());  
  map.getOverlays().add(new SitesOverlay(marker));  
  me=new MyLocationOverlay(this, map);
  map.getOverlays().add(me);
  

//registerForContextMenu(); <-- 이부분

public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)
 {
  menu.add(Menu.NONE, ADD_ID, Menu.NONE, "Add");
 }
 
 public boolean onContextItemSelected(MenuItem item) {
  switch (item.getItemId()) {
   case ADD_ID:
    add();
    return(true);
  }
  return(super.onOptionsItemSelected(item));
 }

이렇게 소스를 만들었습니다.

그런데 주석처리한 부분의 파라미터에 뭘 넣어야할지 도무지 모르겠네요.

MapActivity 에서 ContextMenu 만드는 법좀 가르쳐주시면 감사하겠습니다.

즐거운 하루 되세요~